Closed nadesai closed 2 years ago
Tested with https://twitter.com/nikhil_a_desai and https://twitter.com/nikhil_a_desai/likes (I liked three random tweets in my feed for the purpose of testing):
$ python fetch_data.py likes nikhil_a_desai
Process query nikhil_a_desai
Found 3/2500 tweets.
Done: no more tweets.
First & last tweet dates are: Sun Jan 30 17:13:49 +0000 2022 - Mon Jan 24 23:47:35 +0000 2022
Found 3 tweets.
Found 3 unique authors.
[0] Fetching friends of @cyrusshahpar46
[1] Fetching friends of @alexnazaryan
[2] Fetching friends of @KimberlyTaylor
Successfully exported 3 nodes to out/nikhil_a_desai/nodes.csv.
Successfully exported 1 edges to out/nikhil_a_desai/edges.csv.
Many thanks for the great feature!
Intended to resolve #17.
Summary of changes:
Mode
enum to track whether the script is operating in "users", "tweets", or "likes" mode.fetch_likes
method that usesapi.GetFavorites
to retrieve tweets liked by a user up to a maximum count.fetch_users
to use the newMode
enum and invokefetch_likes
when appropriate.main
to construct aMode
enum from arguments and invokefetch_users
appropriately.