Skip to content

Instantly share code, notes, and snippets.

View julien51's full-sized avatar

Julien Genestoux julien51

View GitHub Profile
@julien51
julien51 / unsubscribe.xml
Created April 21, 2009 21:52
Unsubscription request sent to Superfeedr
<iq type='set' from='you@superfeedr.com/home' to='firehoser.superfeedr.com' id='unsub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<unsubscribe node='http://domain.tld/path/to/feed1.xml' jid='you@superfeedr.com'/>
<unsubscribe node='http://domain.tld/path/to/feed2.xml' jid='you@superfeedr.com'/>
<unsubscribe node='http://domain.tld/path/to/feed3.xml' jid='you@superfeedr.com'/>
</pubsub>
</iq>
<iq type='result' from='firehoser.superfeedr.com' to='you@superfeedr.com/home' id='unsub1' />
<iq type='get' from='you@superfeedr.com/home' to='firehoser.superfeedr.com' id='subman1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub' xmlns:superfeedr='http://superfeedr.com/xmpp-pubsub-ext'>
<subscriptions jid='you@superfeedr.com' superfeedr:page='3'/>
</pubsub>
</iq>
<iq type="result" to="you@superfeedr.com/home" id="subman1" from="firehoser.superfeedr.com">
<pubsub xmlns="http://jabber.org/protocol/pubsub" xmlns:superfeedr="http://superfeedr.com/xmpp-pubsub-ext" >
<subscriptions superfeedr:page="3">
<subscription node="http://domain.tld/path/to/a/feed/atom.xml" subscription="subscribed" jid="you@superfeedr.com" />
<subscription node="http://domain2.tld/path/to/feed.rss" subscription="subscribed" jid="you@superfeedr.com" />
</subscriptions>
</pubsub>
</iq>
<message from='firehoser.superfeedr.com' to='you@superfeedr.com'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<status feed="http://domain.tld/path/to/feed.xml" xmlns="http://superfeedr.com/xmpp-pubsub-ext">
<http code="200">9718 bytes fetched in 1.462708s : 2 new entries.</http>
<next_fetch>2009-05-10T11:19:38-07:00</next_fetch>
</status>
<items node='http://domain.tld/path/to/feed.xml'>
<item>
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>Soliloquy</title>
it "should contain the gists" do
response.should have_tag('h1', %r[Documentation])
end
require "rubygems"
require "nokogiri"
require "xmpp_parser.rb"
xml = <<-EOXML
<stream:features>
<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'>
<required/>
</starttls>
<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
module Babylon
##
# This is the XML SAX Parser that accepts "pushed" content
class XmppParser < Nokogiri::XML::SAX::Document
attr_accessor :elem, :doc, :parser, :top
##
# Initialize the parser and adds the callback that will be called upon stanza completion
require "rubygems"
require 'nokogiri'
doc = Nokogiri::XML::Document.new
loop do
puts `ps -o rss= -p #{Process.pid}`.to_i
n = Nokogiri::XML::Element.new('e', doc)
n.add_namespace(nil, 'http://example.com')
end
module Babylon
##
# This is the XML SAX Parser that accepts "pushed" content
class XmppParser < Nokogiri::XML::SAX::Document
attr_accessor :elem, :doc, :parser
##
# Initialize the parser and adds the callback that will be called upon stanza completion