https://github.com/pygeek03/boosted_tweets
A set of scripts being developed with the goal to collect a dataset of viral tweets that exhibit signs of being automatically propagated.
https://github.com/pygeek03/boosted_tweets
botometer twitter-api twitter-bot
Last synced: 9 months ago
JSON representation
A set of scripts being developed with the goal to collect a dataset of viral tweets that exhibit signs of being automatically propagated.
- Host: GitHub
- URL: https://github.com/pygeek03/boosted_tweets
- Owner: PyGeek03
- Created: 2021-06-18T22:10:18.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-27T13:18:42.000Z (over 4 years ago)
- Last Synced: 2025-04-07T12:46:57.761Z (over 1 year ago)
- Topics: botometer, twitter-api, twitter-bot
- Language: Python
- Homepage:
- Size: 4.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# boosted_tweets
A set of scripts being developed with the goal to collect a dataset of viral tweets that exhibit signs of being automatically propagated.
## Quickstart:
1. Clone this repo and change your working directory to it
2. Install all dependencies:
```
$ pip install -r requirements.txt
```
3. Sign up for access to [Twitter API](https://developer.twitter.com/en/apply/user.html) and [Botometer API](https://rapidapi.com/OSoMe/api/botometer-pro)
4. Create a new file called `.env`, whose content is the API keys:
```
CONSUMER_KEY={Twitter API's consumer key}
CONSUMER_SECRET={Twitter API's consumer secret key}
ACCESS_TOKEN={Twitter API's access token}
ACCESS_TOKEN_SECRET={Twitter API's access token secret key}
BEARER_TOKEN={Twitter API's bearer token}
RAPIDAPI_KEY={Rapid API key, to access Botometer API}
```
## Workflow:
1. Find a viral tweets, possibly by finding trending topics (using `get_trends_twarc1.py`) and then searching for related tweets, or finding popular tweets for the highest trending topic (using `get_top_trending_tweets_twarc1.py`)
2. Get the whole conversation (retweets and replies) associated with this tweet (using `get_conversation_twarc2.py`). This conversation will be saved to a .json file
3. Use Botometer API to check if participating accounts in this conversation are bots (using `use_botometer.py` and the above .json file)
4. Visualize the conversation (using `visualize_conversation_tree.py` and the above .json file), as a tree whose root is the author of the original tweet and other nodes are the authors of retweets and replies. Accounts that might be bot will be tagged with bot probability score. Sibling nodes (children of the same parent node) are ordered according to their tweet's timestamp. The output will be saved to a .txt file
Note: all output files are saved under the `outputs/` directory
## Dependencies:
- botometer==1.6
- python-dotenv==0.17.1
- requests==2.25.1
- treelib==1.6.1
- twarc==2.1.7
- tweepy==3.10.0