SaveCredential: Save and load credential information

Description Usage Arguments Value Note Examples

View source: R/Authenticate.R

Description

Functions to save and load credential information. Currently, credential information will be stored as a RDS file. SaveCredential will return the input credential, useful for working as a filter between the Authenticate and Collect.

Usage

1
2
3
SaveCredential(credential, filename = "credential.RDS")

LoadCredential(filename = "credential.RDS")

Arguments

credential

credential object

filename

character, filename to be saved to or restored from

Value

credential object

Note

credential created from Authenticate with socialmedia = 'twitter' will not be saved by SaveCredential

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
require(magrittr)
myAppID <- "123456789098765"
myAppSecret <- "abc123abc123abc123abc123abc123ab"
myUsernames <- c("senjohnmccain","obama")

Authenticate("instagram",
appID = myAppId,
appSecret = myAppSecret) %>% SaveCredential("instagramCred.RDS") %>% Collect(ego = TRUE,
username = myUsernames) %>% Create

## Load the previously saved credential information
LoadCredential("instagramCred.RDS") %>% Collect(tag="obama",
distance=5000, n=100) %>% Create("bimodal")

## End(Not run)

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