Take snapshots of the Twitter trending topics for a specific location (based on Twitter woeid) and provides statistics.
Take snapshots of the trending topics for a specific location, save them on a MongoDB collection and provide history and statistics. Trending topics are collected from the specified Twitter woeid (location id, translated from string place name) and saved togetehr with sample tweeps for each topic. The module also provides, command-line form, the history of the collected topics and statistics for each topics (first and last appearances, total volume, ranks, total number days in trending topics)
The main entry point file is trends_app.py
To get a local copy up and running follow these simple steps.
Install all prerequisites from the included requirements.txt.
- pip install -r /path/to/requirements.txt
-
Clone the repo
git clone https://github.com/github_shaishulman/TrendTrackr-app.git
-
Install prerequisites
pip install -r /path/to/requirements.txt
-
Apply for a standard product Twitter API key
https://developer.twitter.com/en/docs/twitter-api/getting-started/getting-access-to-the-twitter-api
-
Open a free MongoDB user account and get connection string
https://www.mongodb.com/cloud/atlas/register
-
Store both Twitter API keys and MongoDB connection string in a file named keys.json (see the included keys_BLANK.json for example)
-
Save all current trending topics in New York City
python trends_app.py --save "New York City"
-
Display history of all trending collected since 1 Sep 2021
python trends_app.py --date "1/09/2021"
-
Display statistics (first and last appearances, total volume, total number of days) for all topics collected
python trends_app.py -sta
-
Display dates of being a trending topic for the specific topic "afganistan"
python trends_app.py --name afganistan
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Shai Shulman - @shaishulman - shai.shulman@gmail.com
Project Link: https://github.com/github_shaishulman/TrendTrackr-app