Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
/ slack-weather Public archive

Ruby scripts that scrape weather data from Meteo.gr and post it to a Slack channel

License

Notifications You must be signed in to change notification settings

agorf/slack-weather

Repository files navigation

slack-weather

A bunch of Ruby scripts that scrape Meteo.gr for weather data (temperature, humidity, wind, dust) and post it as a nicely-formatted message to a Slack channel.

Installation

Clone the repo:

git clone https://github.com/agorf/slack-weather.git
cd slack-weather/

If you have Docker, you don't need Ruby, Bundler etc. Just build the image:

docker build -t slack_weather .

If you don't have Docker, install the necessary Gems using Bundler:

bundle install

Configuration

With environment variables:

  • SLACK_WEATHER_WEBHOOK_URL is the Slack webhook URL to post to
  • SLACK_WEATHER_CITY_ID is the id of the city in Meteo.gr (default is 12 for Athens)

It is also possible to define these variables in a .env file in the same directory and they will be loaded automatically.

Use

If you have Docker:

SLACK_WEATHER_WEBHOOK_URL=... docker run --rm -e SLACK_WEATHER_WEBHOOK_URL slack_weather

If you don't:

SLACK_WEATHER_WEBHOOK_URL=... bundle exec ruby slack_poster.rb

You can run this with cron e.g. once per day at 5 pm:

0 17 * * * SLACK_WEATHER_WEBHOOK_URL=... bundle exec ruby slack_poster.rb

License

MIT

Author

Angelos Orfanakos

About

Ruby scripts that scrape weather data from Meteo.gr and post it to a Slack channel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published