Skip to content

Instantly share code, notes, and snippets.

require "rubygems"
require "blather/client"
module Test
extend Blather::DSL
setup("user@localhost/test", "secret", "localhost", 5222)
#setup("component.localhost", "secret", "localhost", 5347)
when_ready do
D, [2009-06-03T17:03:02.975315 #32267] DEBUG -- : << <message type='chat' to='utterance.localhost' from='nolan@localhost/Eee' id='purple22543b60' xmlns='jabber:client'><x xmlns='jabber:x:event'></x><active xmlns='http://jabber.org/protocol/chatstates'></active></message>
D, [2009-06-03T17:03:02.975569 #32267] DEBUG -- : PARSING: (<message type='chat' to='utterance.localhost' from='nolan@localhost/Eee' id='purple22543b60' xmlns='jabber:client'><x xmlns='jabber:x:event'></x><active xmlns='http://jabber.org/protocol/chatstates'></active></message>)
D, [2009-06-03T17:03:02.976023 #32267] DEBUG -- : START ELEM: ({:uri=>"jabber:client", :prefix=>nil, :ns=>{nil=>"jabber:client"}, :elem=>"message", :attrs=>{"from"=>"nolan@localhost/Eee", "id"=>"purple22543b60", "to"=>"utterance.localhost", "type"=>"chat"}})
D, [2009-06-03T17:03:02.976785 #32267] DEBUG -- : START ELEM: ({:uri=>"jabber:x:event", :prefix=>nil, :ns=>{nil=>"jabber:x:event"}, :elem=>"x", :attrs=>{}})
D, [2009-06-03T17:03:02.977483 #32267] DEBUG -- : END E
D, [2009-06-05T00:02:55.581833 #18758] DEBUG -- : NEW JID: echo@localhost/echo
D, [2009-06-05T00:02:55.582841 #18758] DEBUG -- : SENDING: (/var/lib/gems/1.8/gems/blather-0.4.0/lib/blather/stream.rb:77:in `connection_completed') <stream:stream to='localhost' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en' >
D, [2009-06-05T00:02:55.584574 #18758] DEBUG -- :
------------------------------
D, [2009-06-05T00:02:55.584796 #18758] DEBUG -- : << <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='95765323' from='localhost' version='1.0'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><auth xmlns='http://jabber.org/features/iq-auth'></auth></stream:features>
D, [2009-06-05T00:02:55.584945 #18758] DEBUG -- : PARSING: (<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/s
/var/lib/gems/1.8/gems/blather-0.4.0/lib/blather/stream/parser.rb:94:in `error': EndTag: '</' not found (Blather::ParseError)
from /var/lib/gems/1.8/gems/nokogiri-1.3.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `native_write'
from /var/lib/gems/1.8/gems/nokogiri-1.3.0/lib/nokogiri/xml/sax/push_parser.rb:47:in `<<'
from /var/lib/gems/1.8/gems/blather-0.4.0/lib/blather/stream/parser.rb:22:in `<<'
from /var/lib/gems/1.8/gems/blather-0.4.0/lib/blather/stream.rb:85:in `receive_data'
from /var/lib/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run_machine'
from /var/lib/gems/1.8/gems/eventmachine-0.12.8/lib/eventmachine.rb:242:in `run'
from /home/nolan/Projects/Utterance/bin/utterance:12
from /var/lib/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:215:in `call'
from /var/lib/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:215:in `start_proc'
#!/usr/bin/env ruby
require 'blather/client'
Blather.logger.level = Logger::DEBUG
when_ready { puts "Connected ! send messages to #{jid.stripped}." }
subscription :request? do |s|
write s.approve!
end
package info.hermesgps.hermes.models
import org.openstreetmap.osmosis.core.domain.v0_6.{Entity => OSMEntity}
class Entity(obj:OSMEntity) {
def name {
"Entity"
}
}
package info.hermesgps.hermes.model
import scala.collection.immutable.Map
import org.openstreetmap.osm.data.IDataSet
import org.openstreetmap.osmosis.core.domain.v0_6.{Tag, WayNode}
import org.openstreetmap.osmosis.core.domain.v0_6.{Entity, Node, Relation, Way}
/*
* Superclass for rich OSM entities.
*/
class RichEntity(val obj:Entity, val dataset:IDataSet) {
spectrum@thewordnerd:~$ spectrum facebook
[10:47:05] <Localization> cs locale found
[10:47:05] <gloox> connecting to: 127.0.0.1 as facebook.thewordnerd.info with password secret
Can't connect to SQL-VIP database, using built-in.
(10:47:05) prefs: Reading /usr/local/var/lib/spectrum/facebook/prefs.xml
thewordnerd = Host(name="thewordnerd.info" routes = {"/": Dir(base="static/thewordnerd.info/", index_file="index.html")})
www_thewordnerd = Host(name="www.thewordnerd.info", routes = {"/": Dir(base="static/thewordnerd.info/", index_file="index.html")})
spielproject = Host(name="spielproject.info" routes = {"/": Proxy(addr='127.0.0.1', port=9000)})
www_spielproject = Host(name="www.spielproject.info", routes={"/": Proxy(addr='127.0.0.1', port=9000)})
hudson = Host(name="hudson.thewordnerd.info" routes={
"/": Proxy(addr='127.0.0.1', port=9001)
})
{click: function() {
alert("Clicked")
return false
}}