knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
R wrapper for the Twitch API.
# install.packages("devtools") devtools::install_github("koderkow/twitch")
http://localhost
.Renviron
to add these valuesusethis::edit_r_environ()
in the RStudio R consoleTWITCH_CLIENT_ID=YOUR CLIENT ID
TWITCH_SECRET=YOUR SECRET
Read about getting authorization tokens here.
library(twitchr)
Get auth token by using twitch_auth()
. This will be appended to future API calls
twitch_auth()
Look up a user by their display name to get user information. This is userful to obtain broadcaster_id
for other functions
user <- get_users(login = "KowAndToilet") user
Obtain a users recent videos
videos <- get_videos(user_id = user$id)
Display the followers of a channel
followers <- get_follows(to_id = user$id)
Display who is currently in a broadcasters chat
chatters <- get_chatters("KowAndToilet")
I have covered most of the Twitch API endpoints which can be viewed here. If there are any you would like added please create an issue! :)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.