Created
March 27, 2015 12:25
-
-
Save infovore/1911bbce0bac889de00c to your computer and use it in GitHub Desktop.
Ruby script to spit out what's playing, by who, on 6Music right now, into your shell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://www.bbc.co.uk/6music')) | |
artist = doc.css('.realtime-now-playing .rtm-np-artist').text.strip | |
track = doc.css('.realtime-now-playing .rtm-np-track').text.strip | |
puts "#{track} - #{artist}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment