19 points · by adam_tavener · 10y ago · 1 comment
ruby -e 'require "json"; require "net/http"; track=JSON.parse(Net::HTTP.get_response(URI("http://polling.bbc.co.uk/radio/nowandnextservice/bbc_6music.json")).body)["message"]; puts %w(title artist).map{|k| track[k]}.join(", ")' | tee -a ~/music.txt
the json service there is what powers the now&next on the station's website. I'm sure that code could be neater, but just threw it together and it does the job.I guess you could adapt this to add the current track to your Google Playlist.