Open masterkain opened 13 years ago
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 { ... }
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.
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
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.
As seen here: http://itunes.apple.com/rss