AuthenticateWithInstagramAPI: Note: this function is DEPRECATED and will be removed in a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/AuthenticateWithInstagramAPI.R

Description

Instagram API Authentication

Usage

1
AuthenticateWithInstagramAPI(appID, appSecret, useCachedToken)

Arguments

appID

character string specifying the 'App ID' of the Instagram app used for authentication.

appSecret

character string specifying the 'API Secret' associated with the Instagram App used for authentication.

useCachedToken

logical. If TRUE then this function will look for a saved token in the current working directory (name of token file must be fb_oauth). If fb_oauth token is not found, then it will create a token and save it to current working directory (i.e. for future use).

Details

OAuth token based authentication with the Instagram API, with caching options for automatic authentication (i.e. avoid using the browser).

In order to collect data from Instagram, the user must first authenticate with Instagram's Application Programming Interface (API). Furthermore, the user must create a Instagram 'app' and get an 'app secret'.

To get a Instagram 'app ID' and 'API secret', please see the Instagram document at: https://instagram.com/developer/authentication/

One problem with Instagram authentication through R is that it normally requires the user to authenticate using their browser each time they wish to collect data. The useCachedToken argument provides a way to circumvent this, by saving and loading an authenticated 'token' file stored in the working directory. If the useCachedToken argument is set to TRUE, then the browser is not necessary for future sessions.

Value

An OAuth access token that enables R to make authenticated calls to the Instagram API.

Author(s)

Timothy Graham <timothy.graham3@uq.net.au> & Robert Ackland <robert.ackland@anu.edu.au>

See Also

AuthenticateWithTwitterAPI and AuthenticateWithYouTubeAPI and AuthenticateWithFacebookAPI for other ways to collect social media data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
  ## Use your own values for myAppID and myAppSecret
  app_id <- "123456789098765"
  app_secret <- "abc123abc123abc123abc123abc123ab"

  # Authenticate with the Instagram API using `AuthenticateWithInstagramAPI`
  instagram_oauth_token <- AuthenticateWithInstagramAPI(appID=app_id,
    appSecret=app_secret, useCachedToken=FALSE)
  
## End(Not run)

SocialMediaLab documentation built on May 29, 2017, 9:41 p.m.