Twitter API: Check if a tweet is a retweet

前端 未结 9 2432
南笙
南笙 2020-12-15 05:33

I have found this question. However I think this has changed on API version 1.1.

If I use the search/tweets method, how can I see if the tweet is a RT?

9条回答
  •  醉酒成梦
    2020-12-15 06:03

    Just to add a bit more. (using twitter gem (ruby language))

    You can check if its a retweet by checking the tweet and then getting what you need from the retweeted_status hash

    t = client.status(#########) #function that obtains tweet based on ID where # = tweet ID
    puts t.retweeted_status? # returns true or false
    t.retweeted_status # returns the actual hash for that
    

提交回复
热议问题