Instagram Weather Bot

Instagram bot for automated daily weather reports written in python

The scope of this python project was to automatically post weather data and water temperature for Lake Starnberg ( wetter.am.see) and Ammersee ( wetter.am.ammersee) to instagram. The project code is available in a github repo.

Following subtasks are accomplished:

  • parse a .json configuration file for target locations and authentication tokens
  • retrieve weather data for the day of posting and the next day using an API
  • scrape water temperature from the site of the Waterscience Service Bavaria
  • combine the collected data with a background .png image using pillow
  • use instagrapi to authenticate with instagram and upload the images
In its current configuration the bot publishes weather and water data for the day of posting (left) and weather forecast for the next day (right). It could easily be adjusted to provide 3 or more days.

Using a cronjob the script runs once a day on my VPS.

During the project I applied multiple new concepts in python, especially

  • using APIs
  • web scraping
  • image manipulation
  • configuration file layout and parsing
  • keeping the code flexible so it can easily be adapted for new locations