Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.
/ nswbushfires Public archive

Twitter bot for posting current incidents from the NSW bushfires website

License

Notifications You must be signed in to change notification settings

auxesis/nswbushfires

Repository files navigation

Dependencies

  • ruby
  • rake
  • bundler

Setup

Setup data dir + run bundler with:

$ rake setup

Once you've created an account, register the application with Twitter:

http://dev.twitter.com/apps/new

Note the consumer key & consumer secret on the application page, follow the "My Access Token" link, and note the access token and access secret.

Create a config.yaml with the previously noted details:

---
:consumer_token: "consumer_token_of_doom"
:consumer_secret: "consumer_secret_of_doom"
:access_token: "accces_token_of_doom"
:access_secret: "access_secret_of_doom"

set up a cron job:

$ crontab -e

*/15 * * * * /path/to/project/nswbushfires.sh

How it works

fetcher.rb gets latest current incidents list from RFS GeoRSS feed, extracts data from it, and writes it out in YAML.

poster.rb compares the last two YAML files, and posts the differences to Twitter. Also builds a shortened GMaps url for viewing incident location, and embeds lat/lng data in Twitter update.

nswbushfires.sh wraps both, making it suitable for running out of cron.

Operational improvements

Standalone server PagerDuty notifications

  • if no notification has been sent in the last 24 hours
  • if there are Twitter failures (posting, authentication) Logging Web interface to review updates cap deploy workflow

About

Twitter bot for posting current incidents from the NSW bushfires website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published