yt_oauth: Set up Authorization

Description Usage Arguments Value References Examples

Description

The function looks for .httr-oauth in the working directory. If it doesn't find it, it expects an application ID and a secret. If you want to remove the existing .httr-oauth, set remove_old_oauth to TRUE. By default, it is set to FALSE. The function launches a browser to allow you to authorize the application

Usage

1
2
yt_oauth(app_id = NULL, app_secret = NULL, scope = "analytics",
  token = ".httr-oauth", ...)

Arguments

app_id

client id; required; no default

app_secret

client secret; required; no default

scope

Character. analytics or monetary-analytics. Required. Default is monetary-analytics. The scopes are largely exchangeable but monetary-analytics yields extra authorizations that come in handy.

token

path to file containing the token. If a path is given, the function will first try to read from it. Default is .httr-oauth in the local directory. So if there is such a file, the function will first try to read from it.

...

Additional arguments passed to oauth2.0_token

Value

sets the google_token option and also saves .httr_auth in the working directory (find out the working directory via getwd())

References

https://developers.google.com/youtube/analytics/v1/reference/

https://developers.google.com/youtube/analytics/v1/reference/ for different scopes

Examples

1
2
3
4
5
 ## Not run: 
  yt_oauth("998136489867-5t3tq1g7hbovoj46dreqd6k5kd35ctjn.apps.googleusercontent.com", 
           "MbOSt6cQhhFkwETXKur-L9rN")

## End(Not run)

tubern documentation built on May 1, 2019, 10:10 p.m.