Authenticate: Create credential to access social media APIs

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

View source: R/Authenticate.R

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

1
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

Note

Currently, Authenticate with socialmedia = "twitter" generates oauth information to be used in the current active session only (i.e. "side-effect") and no authentication-related information will be stored in the returned credential object.

Author(s)

Chung-hong Chan <chainsawtiney@gmail.com>

See Also

AuthenticateWithFacebookAPI, AuthenticateWithInstagramAPI, AuthenticateWithYoutubeAPI, AuthenticateWithTwitterAPI, SaveCredential, LoadCredential

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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')

## End(Not run)

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