How can I generate a query for retreiving text of liked tweets of a list of users? #689
-
Hello, I would like to know if is it possible to use the following command: Thanks a lot |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Unfortunately the command line doesn't have an already working command to do this in bulk, but you can script it in bash For example, if you have an
This should get likes of each of them: while read line; do twarc2 liked-tweets "$line" "likes_of_$line.jsonl" && echo $line; done < input.txt This will create Alternatively, using https://twarc-project.readthedocs.io/en/latest/api/client2/#twarc.client2.Twarc2.liked_tweets is the function to call, but this way you'll have to manage your own way of writing output - the function is a generator that returns API response pages. |
Beta Was this translation helpful? Give feedback.
Unfortunately the command line doesn't have an already working command to do this in bulk, but you can script it in bash
For example, if you have an
input.txt
with 1 user per line like this (it should work with either usernames or user IDs):This should get likes of each of them:
This will create
likes_of_user1.jsonl
,likes_of_user2.jsonl
,likes_of_user3.jsonl
.Alternatively, using https://twarc-project.readthedocs.io/en/latest/api/client2/#twarc.client2.Twarc2.liked_tweets is the function to call, but this way you'll have to manage your own way of writing output - the…