oceanician
oceanician

Reputation: 399

With the twitter gem, how do I retweet a Twitter::Tweet from Twitter::REST:Tweets.retweet?

I have an instance of Twitter::Tweet, which does not have a method retweet. ( http://www.rubydoc.info/gems/twitter/Twitter/Tweet )

However, Twitter::REST::Tweets does have a method I can use to retweet. ( http://www.rubydoc.info/gems/twitter/Twitter/REST/Tweets#retweet-instance_method )

I can't find an example over at: https://github.com/sferik/twitter

Any help appreciated. I've probably just left it too late at night to be figuring things out.

Cheers, Ian.

Upvotes: 3

Views: 1066

Answers (1)

oceanician
oceanician

Reputation: 399

Ok. So, you only ever figure it out a few minutes after sharing how rubbish you are with stackoverflow :)

If you have an instance of Twitter::Tweet, and lets call that tweet, you can retweet it using the client.

So:

@client.retweet tweet

Will RT the tweet.

I'll try and add this into the wiki for twitter-gem.

Upvotes: 7

Related Questions