Skip to content

Instantly share code, notes, and snippets.

@maelle
Last active October 4, 2017 06:10
Show Gist options
  • Save maelle/28e477a18db11d12d34a1a09183130b8 to your computer and use it in GitHub Desktop.
Save maelle/28e477a18db11d12d34a1a09183130b8 to your computer and use it in GitHub Desktop.
Get book winner!
library("rtweet")
set.seed(1)
these_are_locke_followers <- rtweet::get_followers("lockedata")
winning_index <- sample.int(nrow(these_are_locke_followers), 1)
this_is_a_locke_winner <- these_are_locke_followers[winning_index,]
this_is_a_locke_winner_info <- rtweet::lookup_users(this_is_a_locke_winner)
paste0(this_is_a_locke_winner_info$name, " (@",
this_is_a_locke_winner_info$screen_name,
praise::praise(") is ${adjective} and won!"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment