Skip to content

Instantly share code, notes, and snippets.

@pelletier
Created November 18, 2010 19:30
Show Gist options
  • Save pelletier/705465 to your computer and use it in GitHub Desktop.
Save pelletier/705465 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rexml/Document'
def parse_opml(content)
opml = REXML::Document.new(content)
body = opml.elements['opml/body']
feeds = []
body.elements.each('outline') do |el|
feeds << {
:url => el.attributes['xmlUrl'],
:name => el.attributes['title']
}
end
return feeds
end
puts parse_opml(File.read('google-reader-subscriptions.xml'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment