Skip to content

Instantly share code, notes, and snippets.

@johnivanoff
Created December 10, 2012 00:22
Show Gist options
  • Select an option

  • Save johnivanoff/4247646 to your computer and use it in GitHub Desktop.

Select an option

Save johnivanoff/4247646 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'nokogiri'
def parse feed
doc = Nokogiri::XML feed
doc.search('item').map do |doc_item|
item = {}
item[:link] = doc_item.at('link').text
item[:thumbnail] = doc_item.at('media|thumbnail').attr('url')
item
end
end
get '/' do
"Feed Aggregator"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment