3

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.

oceanician
  • 399
  • 4
  • 14

1 Answers1

7

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.

oceanician
  • 399
  • 4
  • 14
  • We normally don't like deprecation on SO but I personally love self deprecation ;) – Anthony Nov 05 '14 at 01:09
  • I find that 8pm when coding, the thought process is "I know I'm doing something wrong and stupid. But what?" By 1am, it's certainly even more self-depracting, and seeking last resorts like SO. – oceanician Nov 06 '14 at 10:10