Skip to content

Instantly share code, notes, and snippets.

@infovore
Created March 27, 2015 12:25
Show Gist options
  • Save infovore/1911bbce0bac889de00c to your computer and use it in GitHub Desktop.
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.
#!/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