Is it possible to retweet a status using the twitteR package (or just R in general)?
For example, if I import a bunch of tweets and I want to retweet one of them:
library(twitteR)
# load ROAuth handshake (authorization to interact with Twitter) and check if connection to twitter is established
load(file = "twitteR_credentials")
registerTwitterOAuth(twitCred)
# search Twitter for 25 tweets containing the term '#twitter' and take the first one
tweets = searchTwitter('#twitter', n=25)
favorite_tweet = tweets[1]
# is there a function that lets me retweet favorite_tweet to my own timeline?
I know you can use the updateStatus function to post a status consisting of text, but is there a similar function which lets you update your status by retweeting another status?
I am having this exact same problem trying to make a retweet bot. Python's
tweepyandtwythondon't seem to be playing nice lately, but R is connecting fine to twitter's API. I canupdateStatus("hello world!")alright, but when I try to do something likeupdateStatus(favorite_tweet)as in your example, I get this error:Obviously since in the same session I am able to
updateStatus("hello world!")something is up. They have my authorization, and it's working just fine.The best I can figure out is that
favorite_tweetis an object of class status. This seems to be preventingupdateStatus()from interpreting it as a string that can be retweeted. I triedunlist()and manipulating it withgsub()but haven't found a good solution yet. If I do, I'll let you know (and I hope if you do, you'll let me know).