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.
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
With environment variables:
SLACK_WEATHER_WEBHOOK_URL
is the Slack webhook URL to post toSLACK_WEATHER_CITY_ID
is the id of the city in Meteo.gr (default is12
for Athens)
It is also possible to define these variables in a .env
file in the same
directory and they will be loaded automatically.
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