Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

[feature] Parse RSS data #3

Open
masterkain opened this issue Jun 21, 2011 · 4 comments
Open

[feature] Parse RSS data #3

masterkain opened this issue Jun 21, 2011 · 4 comments

Comments

@masterkain
Copy link
Contributor

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

@stve
Copy link
Collaborator

stve commented Jun 23, 2011

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 { ... }

@benmoss
Copy link

benmoss commented Jun 25, 2011

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.

@masterkain
Copy link
Contributor Author

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

@stve
Copy link
Collaborator

stve commented Jun 26, 2011

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants