The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
I’m tuned to Virgin Radio Classic Rock

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Premshree Pillai

Posts: 478
Nickname: premshree
Registered: Mar, 2004

Premshree Pillai is a Ruby evangelist, working with Yahoo!.
I’m tuned to Virgin Radio Classic Rock Posted: May 4, 2005 11:29 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Premshree Pillai.
Original Post: I’m tuned to Virgin Radio Classic Rock
Feed Title: Premshree's Personal Weblog
Feed URL: http://premshree.livejournal.com/data/rss
Feed Description: Premshree's Weblog
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Premshree Pillai
Latest Posts From Premshree's Personal Weblog

Advertisement

This is what I'm listening to

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

Read: I&rsquo;m tuned to Virgin Radio Classic Rock

Topic: Why are designers excited about Rails? Previous Topic   Next Topic Topic: Seeing is believing, part 342

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use