This Twitter bot pulls tweets that include the keyword ํ๋ณต (Hanbok: Korean traditional costume) every day at 00:00 and generates a wordcloud from them. It then tweets the wordcloud image.
After posting the image, the bot stores the image and CSV file containing the data of the tweet in the archive folder. ๐ (You can find all the images and CSV files posted by the bot in the archive folder)
Additionally, it has additional features such as creating a header based on the number of tweets that contain the keyword ํ๋ณต and generating a graph from it. ๐
You can find the bot that was running this code for over half a year, but unfortunately, it is no longer active due to Twitter API changes that require a $100 payment. You can check it out here.
Hanbok-Trend
โโโ archive
โ โโโ csv (CSV files containing tweet data)
โ โโโ tags (Wordcloud images of hashtags)
โ โโโ words (Wordcloud images of tweets)
โโโ header (Code for creating header images)
โโโ media (Images for README.md)
โโโ tweet_stream (Code for subscribing to Twitter Stream API)
โโโ main.py (Main code)
- Clone this repository
- Install dependencies
pip install -r requirements.txt
- Create a Twitter app and obtain the API keys
- Run main.py (You can use run.sh)
- If you want to use the header feature, you must run tweet_stream/main.py, which will subscribe to the Twitter Stream API and save the data to a Redis database.
- To install Redis, check here.
- After running tweet_stream/main.py, you can run header/main.py, which will create header images based on the data in the Redis database.