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

Latest commit

 

History

History
58 lines (39 loc) · 1.37 KB

README.md

File metadata and controls

58 lines (39 loc) · 1.37 KB

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