# prep for GET if (!exists("api")) api <- get_api_codes() l <- get_typical_values() maxResults <- l$maxResults playlistId <- l$playlistId video_id = l$videoId base_url <- "https://www.googleapis.com/youtube/v3/videos" api_opts <- list(part = "snippet", id = video_id, maxResults = maxResults, fields="items(snippet(title))", key = api$api_key) # what is this? httr::modify_url( base_url, query = api_opts, httr::config(token = auth.code)) # WORKS!!!! r <- httr::GET(base_url, query = api_opts, httr::config(token= auth.code)) r r <- httr::GET(base_url, query = api_opts) r stop_for_status(r) httr::content(r) str(httr::content(r))
STOP HERE more examples, see 00070 or other files
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.