Using R to send tweets

前端 未结 4 1985
-上瘾入骨i
-上瘾入骨i 2020-12-21 08:45

I saw a cute demonstration of tweeting from R in a presentation some months ago. The scratch code used by the presenter is here:

http://www.r-bloggers.com/twitter-f

4条回答
  •  自闭症患者
    2020-12-21 08:54

    The easiest way to tweet in R through the Twitter-API is to use the twitteR Package. You can set your Twitter-API-APP here: https://apps.twitter.com/

    First step is to authenticate:

    consumer_key <- "yourcredentials"
    consumer_secret <- "yourcredentials"
    access_token <- "yourcredentials"
    access_secret <- "yourcredentials"
    setup_twitter_oauth(consumer_key, consumer_secret, access_token, access_secret)
    

    And just tweet (limit per day:2400 tweets):

    tweet("Hello World")
    

提交回复
热议问题