0

I would like to collect followers/followerIDs of several Twitter users. The problem is that in the end, only the followers of the last user are listed in the table.

clients <- lookupUsers(c('user1', 'user2'))

for(i in 1:length(clients))  {

start <- getUser(clients[i])
twitter.followers <- start$getFollowers(n=NULL)
twitter.followersID <- start$getFollowerIDs(n=NULL)
d <- twListToDF(twitter.followers) } 
f <- write.table(d, file = "twitter2", row.names = FALSE, sep = "\t", dec = ",")

Actually, I don't need that detailed information the twListToDF-command provides. I would just like to create a file which lists followers and IDs for more than one user.

Thomas
  • 43,637
  • 12
  • 109
  • 140
  • Put `append=TRUE` in your last line of code. – Thomas Dec 16 '13 at 19:21
  • Thomas, thank very much for the quick answer. It now works but, the problem I have in general is that for users with a large number of followers, the Twitter API returns: Error in twInterfaceObj$doAPICall(paste("users", "lookup", sep = "/"), : Error: Client Error (429) I think that this is due to Twitter's rate limit: https://dev.twitter.com/docs/rate-limiting/1.1. Does anyone have an idea how to work around that problem? – user3108517 Dec 17 '13 at 13:41
  • Try this: http://stackoverflow.com/questions/15605437/r-twitter-package-get-followers-despite-limit?rq=1 – Thomas Dec 17 '13 at 14:30

0 Answers0