Word Of The Day bot
Post daily word definitions on social media.
Twitter account: https://twitter.com/WordOfTheDay_B
Introduction
The goal of this project is to create a bot that posts a "word of the day" style update, which contains a random word and its definition.
The main process flow is the following:
- Retrieve a random word and its definition through the use of a 3rd-party API
- Generate an HTML page with the retrieved data using a template
- Render the HTML page into an image
- Post the image to social media
The social media posts are performed every day through the Twitter schedule Action
Technologies used
Here is a list of the technologies that were used as part of the project:
- Python3 as main language
- unittest for testing
- WordsAPI from RapidAPI for random words and definitions
- Jinja2 with HTML/CSS for templating
- wkhtmltoimage for image rendering
- TwitterAPI for Twitter integration
- GitHub Actions for continuous integration and scheduled tasks
- Vim as editor
- Trello for project management
Local development
Create or workon the virual environment:
workon word-of-the-day
Install dependencies using requirments file:
pip install -r requirements.txt
Run unit tests:
python -m unittest discover tests/unit/
Generate a new image and open it (Ubuntu only):
generate_and_open