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?
This should do the trick:
Note that your favorite_tweet is still a list, so it might be slightly better to rather do:
which gets rid of extraneous indexing.
The key though is that you are wanting to retweet the text content of the tweet, not the tweet object itself.