简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM