Receive multiple tweets for several users

18 views
Skip to first unread message

Michael Jester

unread,
Jun 14, 2017, 3:09:54 PM6/14/17
to rtweet
Hello,

I am currently using tweets_data to get the first tweet for a bunch of users. Would it be possible to get the Nth most recent tweets for a group of users?

mike.wayn...@gmail.com

unread,
Jun 14, 2017, 6:38:24 PM6/14/17
to rtweet
Not to my knowledge. You'd have to pass the user IDs or screen names to the get_timeline() function. That'd return the most recent tweets for each user with a limit being 3200 tweets. 

Twitter's API rate limits dictate a maximum of 900 of these [timeline] requests per 15 minutes, which, if you get the max (3200) tweets per user, translates to about 56 users every 15 minutes.

Here's some example code of what i mean:


## get a data frame of users data
usrs
<- search_users("\"rstats\"")


## get user timelines (up to 3200 of most recent tweets) using user IDs
tmls
<- lapply(usrs$user_id[1:10], get_timeline, n = 3200)


## combine into single data frame
tmls
<- do.call("rbind", tmls)


Reply all
Reply to author
Forward
0 new messages