itunes icon indicating copy to clipboard operation
itunes copied to clipboard

[feature] Parse RSS data

Open masterkain opened this issue 14 years ago • 4 comments

As seen here: http://itunes.apple.com/rss

masterkain avatar Jun 21 '11 22:06 masterkain

Nice find. I could envision a really nice DSL around the feeds, something like:

results = Itunes::Rss.country('UK').media_type('toppaidbooks').limit(10)
results.each { ... }

stve avatar Jun 23 '11 03:06 stve

Do you think you're gonna implement this?

I tried poking around in the code a little but it doesn't seem like it really fits into this gem. It'd require a lot of restructuring or just compartmentalizing of the code for the different endpoints.

benmoss avatar Jun 25 '11 21:06 benmoss

I was quickly tinkering around:

source = "http://itunes.apple.com/WebObjects/MZStore.woa/wpa/MRSS/newreleases/sf=143441/limit=10/explicit=true/rss.xml" # url or local file
content = "" # raw content of rss feed will be loaded here
open(source) do |s| content = s.read end
@rss = RSS::Parser.parse(content, false)

Seems to work, however source = "http://itunes.apple.com/us/rss/topalbums/limit=10/explicit=true/xml" Will not.

Anyway I'm still wondering about the Itunes classes defined here: http://rubydoc.info/stdlib/rss/1.8.7/RSS

masterkain avatar Jun 26 '11 09:06 masterkain

The more I think about it, the more I think this should be a separate gem. I've prototyped some code as well, how about something like this?

https://gist.github.com/1047870

You might also want to check out my itunes-charts gem which screen scrapes http://www.apple.com/itunes/charts/. I didn't realize RSS feeds were available when I wrote it.

stve avatar Jun 26 '11 19:06 stve