Reputation: 33
I want to collect some data from Twitter with twarc2. I want to collect the data between specific duration and limit the collection to a daily basis. For example, between the 1st of July to the 10th of July, limit the collected tweets to 100 tweets per day. Is it possible to do it once, or should I execute the code 10 times?
Upvotes: 0
Views: 75
Reputation: 332
I am not aware of a way to run this in one command. One solution I would suggest is to write a bash script that contains all of the individual twarc2 calls. Then you can call that script only once.
For example, you could create a bash script called ten_queries.sh
that looks like the below:
#!/bin/bash
twarc2 search --start-time 2022-09-16T00:00:00 --end-time 2022-09-17T00:00:00 blacklivesmatter 2022-09-16_tweets.jsonl
twarc2 search --start-time 2022-09-17T00:00:00 --end-time 2022-09-18T00:00:00 blacklivesmatter 2022-09-17_tweets.jsonl
...
And then just add a line for each day.
Upvotes: 1