-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtweet_retriever_main.py
31 lines (24 loc) · 974 Bytes
/
tweet_retriever_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import argparse
from src.scraper.runners.tweet.scraper_tweet_runner import ScraperTweetRunner
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--iterations", type=int, default=1)
parser.add_argument("-c", "--chunk_size", type=int, default=60)
parser.add_argument("-t", "--threads", type=int, default=6)
parser.add_argument("-f", "--csv_file", type=str, default=None)
parser.add_argument("-n", "--dataset_name", type=str)
args = parser.parse_args()
iterations = args.iterations
chunk_size = args.chunk_size
threads = args.threads
tweet_ids_path = args.csv_file
source = args.dataset_name
if tweet_ids_path and source:
runner = ScraperTweetRunner(
iterations_number=iterations,
chunk_size=chunk_size,
threads=threads,
tweet_ids_path=tweet_ids_path,
data_source=source
)
runner.start_scraping()