Twitter API: Check if a tweet is a retweet

前端 未结 9 2342
南笙
南笙 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:09

    The retweeted field is false if the retweet is not done using the retweet button but rahter via RT, so in such a case, just search the "text" field of all tweets for this pattern

    RT @

    This pattern can be of help, but I don't think there is any other function for this.

    0 讨论(0)
  • 2020-12-15 06:14

    To the ones who are using Hydrator1 and relying on its CSV export of the hydrated JSONL file: you can check reweet_id (no it's not a typo in version 0.0.12), and if it's NA then it's an original tweet as I found.

    original_twitter_tweets = twitter_csv_data %>% filter(is.na(reweet_id))
    
    0 讨论(0)
  • 2020-12-15 06:18

    As @Joe Mayo said, check for the retweeted_status key on the status object.

    I have an example that is not caught by @Apoorv Ashutosh's suggestion.

    See: https://twitter.com/gppvt/status/474162466776449024 this will redirect (because it is a retweet) to the original tweet. However if you get this tweet through the twitter API, it has retweeted_status. Notice the text does not contain "RT".

    0 讨论(0)
提交回复
热议问题