Twarc

Latest version: v2.14.0

Safety actively analyzes 685670 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 13 of 22

1.10.1

1.10.0

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.

python
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.

1.9.1

Some further adjustments to CSV generation to properly extract the tweet text from retweets that were fetched from the filter stream.

1.9.0

Premium Search API

**v1.9.0** adds new functionality that allows you to use the [Twitter Premium Search API] endpoints. To use the Premium Search you will need to visit the [Twitter Developer Dashboard] and set up an environment that is attached to one of your apps. Then you should be able to use the label for your environment in your twarc search command.

For example to use the `docnowdev` environment to search the 30 day endpoint you can:

twarc search blacklivesmatter --30day docnowdev > tweets.jsonl

or to search the full archive endpoint:

twarc search blacklivesmatter --fullarchive docnowdev > tweets.jsonl

**Warning:** Depending on your query this could quickly use up your budget! So you will likely also want to use `--from_date` and/or `--to_date` to limit the time range that you are searching. You can also use `--limit` to limit the total number of tweets that are retrieved.

twarc search blacklivesmatter --30day docnowdev --to_date 2013-08-01 > tweets.jsonl

If your app is only authorized for the sandbox you **must** use the `--sandbox` parameter which will alter the maximum number of tweets you will can retrieve in a request down to 100.

This functionality is also made available through the new `Twarc.premium_search` method.

Twitter Labs

v1.9.0 also includes some initial support for the [Twitter Labs] endpoints. At the moment only the sample stream is supported, but we anticipate adding more as they are requested.

twarc --app_auth labs_v1_sample > sample.jsonl

[Twitter Developer Dashboard]: https://developer.twitter.com/en/dashboard
[Twitter Premium Search API]: https://developer.twitter.com/en/docs/tweets/search/api-reference/premium-search
[Twitter Labs]: https://developer.twitter.com/en/labs

1.8.5

A more user friendly error message when running twarc for the first time without doing a `twarc configure` first. Thanks machawk1!

1.8.4

This is a bugfix release for the CSV conversion which was not extracting tweet text from enclosed tweet objects in retweets which hold the fullest representation of the tweet text.

See 329 for context, and thanks to harshbhatt for the bug report!

Page 13 of 22

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.