Skip to content

v1.10.0

Choose a tag to compare

@edsu edsu released this 25 Jun 18:45
d0949df

v1.10.0 changes the behavior of the command line client so that it can also fetch retweets from a file of tweet_ids.

twarc retweets ids.txt > retweets.jsonl

This is in addition to the previous behavior where it accepted a tweet id to fetch the retweets for:

twarc retweets 20 > retweets.jsonl

You can also comma separate the tweet ids on the command line if you want:

twarc retweets 20,21 > retweets.jsonl

The internal interface to the Twarc.reteets has changed to now accept an iterator of tweet ids.

from twarc import Twarc

twitter = Twarc()

for tweet in twitter.retweets([20, 21]):
    print(tweet['id_str'])
    # etc

If you have been using the retweets method in your code you will want to adjust it to pass in a list of ids rather than the bare ids.