| Premshree Pillai ( @ 2005-05-05 11:37:00 |
| Current music: | The Who - Can't Explain |
I’m tuned to Virgin Radio Classic Rock

My music now comes from Virgin Radio Classic Rock. So, in case you want to use this script with that station, you’ll have to make changes to song_title:
$url = 'http://www.virginradio.co.uk/classicrock/last.html'
resp = Net::HTTP.get_response(URI.parse($url))
body = resp.body
if body =~ /<td valign=top><a href=\'[\w\W]+\' class=\'pagecolour\'>([\w\W]*)<\/a><BR><span style=\'font-size:80%;\'>([\w\W]*)<
\/span><\/small><\/td>[\r\n]+/
song_title = [$1, $2].map { |arr_ele|
arr_ele = arr_ele.split(" ").map { |ele|
ele = ele.capitalize
}.join(" ")
}.join(" - ")
else
song_title = '(None)'
end