Skip to content

Instantly share code, notes, and snippets.

@gdiggs gdiggs/wfmu.rb
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.