Skip to content

Instantly share code, notes, and snippets.

@SamWhited
Created November 17, 2012 18:54
Show Gist options
  • Save SamWhited/4098832 to your computer and use it in GitHub Desktop.
Save SamWhited/4098832 to your computer and use it in GitHub Desktop.
Scripts I wrote to manage weather alerts and data
#!/bin/bash
# Used to sync METAR data for Airports I want updates from.
# All data can be fetched via FTP but that's a waste of bandwidth.
curl --silent "http://weather.noaa.gov/pub/data/observations/metar/stations/{KFTY,KATL}.TXT" -o "/var/www/weather.noaa.gov/pub/data/observations/metar/stations/#1.TXT"
#!/bin/bash
# Tweet METAR data using the ruby gem `t'.
# https://twitter.com/METARKFTY
PATH=/usr/local/rvm/gems/ruby-1.9.3-p194/bin/
t update "`cat /var/www/weather.noaa.gov/pub/data/observations/metar/stations/KFTY.TXT | tail -n 1`"
#!/bin/bash
# Send METAR data to a phone.
# Works well as a morning cronjob: 0 9 * * * /path/to/txtMETAR
cat /var/www/weather.noaa.gov/pub/data/observations/metar/stations/KFTY.TXT | tail -n 1 | mail [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment