Created
May 12, 2009 00:19
-
-
Save superfeedr/110247 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "superfeedr" | |
## You can have all the XMPP logging by changing the Skates log level | |
Skates.logger.level = Log4r::DEBUG | |
## | |
# Don't ever forget that all this is ASYNCHRONOUS... | |
# If you don't run EM in your program, then it will started for... however, EM.run begin a blocking call, you shoudl probably run it into a specific Thread to keep the rest of your app running :) | |
Superfeedr.connect("[email protected]", "*********") do | |
puts "Yay... connected ;)" | |
Superfeedr.on_notification do |notification| | |
puts "The feed #{notification.feed_url} has been fetched (#{notification.http_status}: #{notification.message_status}) and will be fecthed again in #{(notification.next_fetch - Time.now)/60} minutes." | |
notification.entries.each do |e| | |
puts " - #{e.title} (#{e.link}) was published (#{e.published}) with #{e.unique_id} as unique id : \n #{e.summary} (#{e.chunk}/#{e.chunks})" | |
end | |
end | |
Superfeedr.subscribe("http://github.com/superfeedr.atom") do |result| | |
puts "Yay, subscribed to the github Atom feed for Superfeedr" if result | |
Superfeedr.unsubscribe("http://github.com/superfeedr.atom") do |result| | |
puts "Sad, you unsubscribed from the github Atom feed for Superfeedr" if result | |
end | |
end | |
Superfeedr.subscribe("http://feeds.feedburner.com/NotifixiousFoundersBlog") do |result| | |
puts "Subscribed to Notifixious' blog" if result | |
end | |
end |
Also I think according to this: http://github.com/superfeedr/superfeedr-ruby/blob/master/lib/stanzas/notification_stanza.rb#L156
I think its e.links on line 17
is it e.links? e.link gives me a fail
Yes, it might be e.links =)
Update it then ;-)
i think it was actually my ruby version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Might want to require "time"