<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Radamanthus Batnag &#187; web</title>
	<atom:link href="http://rad.batnag.org/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://rad.batnag.org</link>
	<description>Random thoughts on web and indie game development.</description>
	<lastBuildDate>Sun, 31 Jul 2011 09:22:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>XMPP Development in Ruby</title>
		<link>http://rad.batnag.org/2010/10/xmpp-development-in-ruby/</link>
		<comments>http://rad.batnag.org/2010/10/xmpp-development-in-ruby/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 13:53:40 +0000</pubDate>
		<dc:creator>rad</dc:creator>
				<category><![CDATA[web]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://rad.batnag.org/?p=152</guid>
		<description><![CDATA[Recently I wasted a day and half in debugging an XMPP-based service I&#8217;m working on. As is usual, the real reason I lost so much time was because I was totally unfamiliar with the terrain. I should have spent an hour or two on XMPP basics before I waded into this unfamiliar territory. If you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I wasted a day and half in debugging an XMPP-based service I&#8217;m working on. As is usual, the real reason I lost so much time was because I was totally unfamiliar with the terrain. I should have spent an hour or two on XMPP basics before I waded into this unfamiliar territory.</p>
<p>If you&#8217;re just starting on XMPP development with Ruby, here are some tips and resources that you might find useful.</p>
<p><strong>One client at a time</strong><br />
For each account, there should only be one XMPP client logged in at any time. If client A is already logged in, and then client B logs in, client A will be disconnected and will stop receiving notifications. Just like in Yahoo! Messenger: when you login from a second client, the first client will be disconnected. It&#8217;s so basic, but I managed to waste the better part of a day on debugging perfectly working code before I realized that this was what&#8217;s going on in my system.</p>
<p><strong>Use <a href="http://github.com/mojodna/switchboard/tree" onclick="pageTracker._trackPageview('/outgoing/github.com/mojodna/switchboard/tree?referer=');">switchboard</a> for testing</strong><br />
When debugging network applications, you want to make sure that the application is indeed the problem and not the network. For web applications, you use <a href="http://en.wikipedia.org/wiki/CURL" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/CURL?referer=');">curl</a> for testing. switchboard aims to be the curl for XMPP development.  curl is a command-line (hence scriptable!) http client; XMPP is a command-line XMPP client.</p>
<p>github page: <a href="http://github.com/mojodna/switchboard/tree" onclick="pageTracker._trackPageview('/outgoing/github.com/mojodna/switchboard/tree?referer=');">http://github.com/mojodna/switchboard/tree</a><br />
command-line usage: <a href="http://mojodna.net/2009/07/16/switchboard-curl-for-xmpp.html" onclick="pageTracker._trackPageview('/outgoing/mojodna.net/2009/07/16/switchboard-curl-for-xmpp.html?referer=');">http://mojodna.net/2009/07/16/switchboard-curl-for-xmpp.html</a></p>
<p><strong>Useful Resources</strong><br />
If you&#8217;re going to do XMPP development in plain Ruby, there&#8217;s a <a href="http://peepcode.com/products/xmpp" onclick="pageTracker._trackPageview('/outgoing/peepcode.com/products/xmpp?referer=');">peepcode screencast</a> that you might find useful. It might be a bit dated, though, and most likely there are higher-level libraries that you can use.</p>
<p>In my case, I was working on harvesting blog entries from Superfeedr, so I use the Superfeedr gem, <a href="http://github.com/superfeedr/superfeedr-ruby" onclick="pageTracker._trackPageview('/outgoing/github.com/superfeedr/superfeedr-ruby?referer=');">superfeedr-ruby</a>. An alternative is the more streamlined and highly opinionated <a href="http://github.com/superfeedr/superfeedr-rb" onclick="pageTracker._trackPageview('/outgoing/github.com/superfeedr/superfeedr-rb?referer=');">superfeedr-rb</a>.</p>
<p>Even if you&#8217;re not doing Superfeedr work, it&#8217;s worth spending the time to study superfeedr-ruby, if only to study how it uses Skates. <a href="http://github.com/julien51/skates" onclick="pageTracker._trackPageview('/outgoing/github.com/julien51/skates?referer=');">Skates</a> (formerly Babylon) is a framework for building XMPP applications in Ruby, using EventMachine for handling connections.</p>
]]></content:encoded>
			<wfw:commentRss>http://rad.batnag.org/2010/10/xmpp-development-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

