Learn R Programming

tuber (version 0.2)

yt_oauth: Set up Authorization

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

yt_oauth(app_id = NULL, app_secret = NULL, scope = "ssl",
  remove_old_oauth = FALSE)

Arguments

app_id
client id; required; no default
app_secret
client secret; required; no default
scope
"ssl" or "basic"; required; default is ssl. The scopes are largely exchangeable but ssl yields extra authorizations that come in handy.
remove_old_oauth
required; default is FALSE. It will remove .httr-oauth if such a file exists in the working directory

Value

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

References

https://console.developers.google.com/project https://developers.google.com/youtube/v3/guides/auth/client-side-web-apps for different scopes

Examples

Run this code
yt_oauth("998136489867-5t3tq1g7hbovoj46dreqd6k5kd35ctjn.apps.googleusercontent.com", 
           "MbOSt6cQhhFkwETXKur-L9rN")

Run the code above in your browser using DataLab