0

I have seen a few posts about this, but I have not been able to use any of the suggested code for the way I have my program set up. I am not very good at R but I need this information for a Political Science class. Could someone please help me figure out a way to avoid receiving the error message "Warning message: In twInterfaceObj$doAPICall(cmd, params, method, ...) : Rate limit encountered & retry limit reached - returning partial results." Thank you in advance! The code I am running is below:

    # install and load packages
    install.packages("twitteR")
    install.packages("ROAuth")
    install.packages("base64enc") 
    install.packages("plyr")
    library("twitteR")
    library("ROAuth")
    library("base64enc")
    library("plyr")

    # Establish the connection (do this once)
    cred$handshake(cainfo="cacert.pem")

    #setup Twitter
    setup_twitter_oauth('Consumer Key - XXXXXXXXXX', Consumer Secret -
    'XXXXXXXXXX', API Key - 'XXXXXXXXXX', API Secret - 'XXXXXXX')

    #store the user
    user <- getUser('JackPosobiec')

    #return a list of followers
    Posobiecfollowers <- user$getFollowers(n=NULL) 
    Posobiecfollowers

    #save followers in a data set
    followers.df = ldply(followers, function(t) t$toDataFrame())
    write.csv(followers.df, file = "JackPosobiecfollowersfile.csv")
Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
  • 3
    `twitteR` is getting out of date, instead use `rtweet` that includes ways to avoid the rate limits: http://rtweet.info/articles/intro.html – fmic_ Nov 17 '17 at 18:51
  • sinQueso is right. [You should be using rtweet not twitteR](http://lists.hexdump.org/pipermail/twitter-users-hexdump.org/2016-August/000050.html). Then the solution would be simple e.g., `rtweet::lookup_followers("JackPosobiec", n = 10000000, retryonratelimit = TRUE)`. – mkearney Nov 25 '17 at 18:41
  • @mkearney do you know how to avoid rate limits all together? For example, is there someone I would need to contact at twitter? Is it a paid service otherwise if I want to avoid the rate limits? New to this... – nak5120 Feb 09 '19 at 02:44

0 Answers0