Learn R Programming

vosonSML (version 0.23.4)

Authenticate: Create credential to access social media APIs

Description

Authenticate creates a credential object that enables R to make authenticated calls to social media APIs. A credential object is a S3 object with the authentication-related information such as access tokens and the information on the social media that grant authentication. Authenticate is the first step of the Authenticate, Collect, Create workflow.

Usage

Authenticate(socialmedia, ...)

Arguments

socialmedia

character string, social media API to authenticate, currently supports "facebook", "youtube", "twitter" and "instagram"

...

additional parameters for authentication

facebook: appID, appSecret

youtube: apiKey

twitter: apiKey, apiSecret, accessToken, accessTokenSecret

instagram: appID, appSecret

Value

credential object with authentication information

See Also

AuthenticateWithFacebookAPI, AuthenticateWithInstagramAPI, AuthenticateWithYoutubeAPI, AuthenticateWithTwitterAPI, SaveCredential, LoadCredential

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
require(magrittr)
## Instagram ego network example
myAppID <- "123456789098765"
myAppSecret <- "abc123abc123abc123abc123abc123ab"
myUsernames <- c("senjohnmccain","obama")

Authenticate("instagram",
appID = myAappId,
appSecret = myAppSecret) %>% Collect(ego = TRUE,
username = myUsernames) %>% Create

## YouTube actor network example
my_apiKeyYoutube <- "314159265358979qwerty"
videoIDs <- c("W2GZFeYGU3s","mL27TAJGlWc")

Authenticate("youtube",
apiKey = my_apiKeyYoutube) %>% Collect(videoIDs = videoIDs) %>% Create('actor')
# }

Run the code above in your browser using DataLab