Skip to content

Instantly share code, notes, and snippets.

@lgs
Created December 30, 2009 19:15
Show Gist options
  • Save lgs/266300 to your computer and use it in GitHub Desktop.
Save lgs/266300 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'superfeedr-rb'
require 'pp'
Superfeedr::Client.connect('[email protected]', '******************') do |client|
client.feed('http://superfeedr.com/dummy.xml') do |status, entries|
pp({
:status => {
:feed => status.feed,
:code => status.code,
:http => status.http,
:next_fetch => status.next_fetch
},
:entries => entries.map { |entry| {
:id => entry.id,
:chunks => entry.chunks,
:chunk => entry.chunk,
:title => entry.title,
:published => entry.published,
:content => entry.content,
:summary => entry.summary,
:categories => entry.categories,
:links => entry.links.map { |link| {
:href => link.href,
:rel => link.rel,
:type => link.type,
:title => link.title
}},
:authors => entry.authors.map { |author| {
:name => author.name,
:email => author.email,
:uri => author.uri
}}
}}
})
end
client.feed('http://github.com/superfeedr.atom') do |notification|
pp notification
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment