Skip to content

Instantly share code, notes, and snippets.

View ricardoflopiza's full-sized avatar

Ricardo Pizarro Schkolnik ricardoflopiza

View GitHub Profile
@ricardoflopiza
ricardoflopiza / get_tweets.R
Created July 3, 2021 01:14 — forked from schochastics/get_tweets.R
Get tweets from the Academic Research product track.
# start_time: %Y-%m-%dT%H:%M:%SZ
# end_time: %Y-%m-%dT%H:%M:%SZ
# needs jsonlite and httr
# next_token can be obtained from meta$next_token to paginate through results
get_tweets <- function(q="",n=10,start_time,end_time,token,next_token=""){
if(n>500){
warning("n too big. Using 500 instead")
n <- 500
}
if(n<5){