Skip to content

Instantly share code, notes, and snippets.

@gdiggs
Last active August 29, 2015 14:14
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 gdiggs/b8c20c17f227ce7551d2 to your computer and use it in GitHub Desktop.
Save gdiggs/b8c20c17f227ce7551d2 to your computer and use it in GitHub Desktop.
Get current song and show on WFMU
require 'nokogiri'
require 'open-uri'
url = 'http://wfmu.org/currentliveshows_aggregator.php?ch=1,4,6,7,8&_=1422680555670'
body = open(url)
document = Nokogiri::HTML(body)
song = document.css('.bigline')[0].text.gsub(/[\n\r]/, ' ').strip
show = document.css('.smallline')[0].text.gsub(/[\n\r]/, ' ').strip
puts "#{song} #{show}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment