Skip to content

Instantly share code, notes, and snippets.

@joshenders
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshenders/69eb503daec40ad399af to your computer and use it in GitHub Desktop.
Save joshenders/69eb503daec40ad399af to your computer and use it in GitHub Desktop.
function npr() {
# Usage: npr
# autoplays NPR radio stream
local day="$(date '+%A')"
local date="$(date '+%m-%d-%Y')"
case ${day} in
Sunday)
local program='10'
;;
Saturday)
local program='7'
;;
*)
local program='3'
;;
esac
local url="http://www.npr.org/player/v2/mediaPlayer.html?action=1&t=3&islist=true&id=${program}&d=${date}"
open "${url}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment