Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 28 lines (17 sloc) 0.924 kB
063d10c @igrigorik woops, use proper name
authored
1 = Ruby / Asynchronous PubSubHubbub Client
c3a7bb9 @igrigorik adding docs
authored
2
063d10c @igrigorik woops, use proper name
authored
3 EventMachine based / asynchronous PubSubHubbub client. Supports posting single or multiple URLs.
c3a7bb9 @igrigorik adding docs
authored
4
5 Full Spec: http://code.google.com/p/pubsubhubbub
6
8c0c54b @igrigorik correct link to blog post
authored
7 HTTP PubSub: Webhooks & PubSubHubbub: http://www.igvita.com/2009/06/29/http-pubsub-webhooks-pubsubhubbub
063d10c @igrigorik woops, use proper name
authored
8
c3a7bb9 @igrigorik adding docs
authored
9 == Simple client example
10
11 EventMachine.run {
063d10c @igrigorik woops, use proper name
authored
12 pub = EventMachine::PubSubHubbub.new('http://pubsubhubbub.appspot.com/publish').publish "http://www.test.com/"
c3a7bb9 @igrigorik adding docs
authored
13
14 pub.callback { puts "Successfully notified hub." }
15 pub.errback { puts "Uh oh, something broke: #{pub.response}" }
16 }
063d10c @igrigorik woops, use proper name
authored
17
18 == Posting multiple URL's
19
20 EventMachine.run {
21 feeds = ["http://www.test.com", "http://www.test.com/2"]
22 pub = EventMachine::PubSubHubbub.new('http://pubsubhubbub.appspot.com/publish').publish feeds
23
24 pub.callback { puts "Successfully notified hub." }
25 pub.errback { puts "Uh oh, something broke: #{pub.response}" }
26 }
27
Something went wrong with that request. Please try again.