This project brings the popular Spotify Wrapped concept to Twitter.
Two main files used in this project:
stream_mentions.py
This file is responsible for authenticating with the Twitter API and streaming real-time bot mentions.generate_image.py
This file is used to generate visuals that include the user's statistics.
You can find the bot on Twitter running this code on Twitter.com/TweetWrapped. The account now has more than 100,000 followers!
- Most liked tweet.
- Most retweeted tweet.
- Most quoted tweet.
- Word-Cloud of frequently used words in tweets.
- The number of tweets that have received more than 100, 500, 1,000, or 10,000 likes.
- Sentiment analysis of tweets.
- Clone this repository
- Apply for a Twitter Developer account
- Create a new file
twitter_credentials.py
- Add your authentication tokens
bearer_token = "XXXXXX"
consumer_key = "XXXXXX"
consumer_secret = "XXXXXX"
access_token = "XXXXXX"
access_token_secret = "XXXXXX"
- Run
stream_mentions.py
The following folders/files can be deleted without affecting the program's functionality:
old/python_api_calls
old/alternative_to_streaming.py
old/file_queue_test.py
old/queue_test.txt
old/two_image_format.py
You can also choose not to stream mentions live and instead create wrapped images for a single user. To do so, follow these steps:
- Open
generate_image.py
. - Scroll down to the bottom of the page and paste the code below:
if __name__ == "__main__":
main(sys.argv[1])
- Replace USERNAME with your Twitter username and run the following command in terminal:
python .\generate_image.py USERNAME