Skip to content

Twitter bot that tweets Umuttepe weather conditions with live camera frames periodically.

License

Notifications You must be signed in to change notification settings

sinanbekar/umuttepe-hava-botu

Repository files navigation

Umuttepe Hava Botu

Publishes the weather conditions of Umuttepe and the live camera frames from kocaeliyiseyret.com on Twitter.

Uses Serverless Framework and deployed to Azure Function App.

In prod. Twitter account: @umuttepedehava


Umuttepe

Kocaeli University's central campus is located in Umuttepe. Umuttepe is one of the places that have unstable weather conditions compared to Izmit Centre because of its 1276 feet (389 meters) altitude.

Used Technologies & Libraries

  • Serverless Framework
  • OpenCV
  • m3u8
  • tweepy

How the app works?

In v1, the app was refactored with Serverless Framework. OpenCV helps to convert m3u8 stream segments to frames. The tweet contains a weather summary from umuttepe-hava.vercel.app/api/weather and two frames from the live camera data from kocaeliyiseyret.com. Tweets are published using tweepy.

Installation

umuttepe-hava-botu requires Python 3.8+ with dependencies to run. It needs a Twitter Developer account and a Redis service.

Clone git repo

git clone https://github.com/sinanbekar/umuttepe-hava-botu
cd umuttepe-hava-botu

Rename .env.example to .env, edit Twitter Developer API keys and Redis environment variables.

Install the dependencies

yarn install
poetry install

For testing

poetry run test

Deployment

To deploy to Azure, see: https://www.serverless.com/framework/docs/providers/azure/guide/quick-start https://www.serverless.com/framework/docs/providers/azure/guide/credentials

yarn deploy # dev stage
yarn deploy --stage production # production

Disclaimer

kocaeliyiseyret.com's contents are copyrighted by Kocaeli Metropolitan Municipality. weather.com crawled data are also used in this project.

Use as only for educational purposes. Use at your own risk.

Contributing

Please feel free to share any ideas.

License

MIT