A python project to run a bot that posts weather forecast and water temperature for a defined lake.
This is a project I did to learn about web scraping, api usage and image manipulation in python.
The example bots post about Lake Starnberg and Ammersee in Bavaria, Germany.
- Clone the repo and setup and activate a venv according to requirements.txt
- Obtain API keys for weatherapi.com and openweathermap.org (fallback) and store them in
weather_api_keys.json
- Create a png with the background for your posts (look at examples, note pixel coordinates of cities to be added) and store it in a subfolder for your bot
- Provide a
caption.txt
in the folder for your bot containing a caption for the post - Configure your bot in
bot_config.json
(remove example entries from config) - Modify the
WeatherBot.get_water_data()
function to retrieve water temp for your lake (or remove the feature) as this function only works with Waterscience Service Bavaria - run
main.py
- Setup a cronjob if you want to run it on a schedule