if (FALSE) {
## for interactive use
yt_get_key()
list_channel_videos(
channel_id = "UCDgj5-mFohWZ5irWSFMFcng",
max_results = 3,
part = "snippet",
auth = "key"
)
## for continuous integration and testing
yt_set_key(httr2::secret_make_key(), type = "package")
x <- httr2::secret_encrypt("YOUR_YOUTUBE_API_KEY", "TUBER_KEY")
yt_set_key(x, type = "api")
yt_get_key(decrypt = TRUE)
list_channel_videos(
channel_id = "UCDgj5-mFohWZ5irWSFMFcng",
max_results = 3,
part = "snippet",
auth = "key"
)
}
Run the code above in your browser using DataLab