DaylightingSociety / SocMap

Social Mapping Framework for Twitter
https://socmap.daylightingsociety.org/
BSD 3-Clause "New" or "Revised" License
18 stars 4 forks source link

Add an option for limiting the age of collected tweets #29

Open milo-trujillo opened 4 years ago

milo-trujillo commented 4 years ago

At present we collect the most recent ~2000 tweets from each user, per Twitter API limits. This can give an uneven approximation of a community, since it does not represent "recent" interactions in a true time sense, and will include the most recent tweets from a user even if they haven't tweeted in months.

Propose adding a --maxage -A flag to the script for specifying an integer (or float?) number of days. No tweets older than this threshold will be collected.

Implementation will require adding optional oldestDate argument to acquireTweets, which can take an epoch time stamp. If any tweets older than that timestamp are detected, break out of the for-loop currently at: https://github.com/DaylightingSociety/SocMap/blob/c8e9f40efdcee2c765cd02b6398d948fecf6bd83/acquire.py#L101-L113

This will not require any changes to analysis.py, or auxiliary tools, or any new interactions with tweepy.