<?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>Coffee Powered &#187; xmpp</title>
	<atom:link href="http://www.coffeepowered.net/tag/xmpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coffeepowered.net</link>
	<description>code and content</description>
	<lastBuildDate>Mon, 09 Jan 2012 18:32:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Jabberish: making Rails talk back</title>
		<link>http://www.coffeepowered.net/2008/09/25/jabberish-making-rails-talk-back/</link>
		<comments>http://www.coffeepowered.net/2008/09/25/jabberish-making-rails-talk-back/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 11:45:49 +0000</pubDate>
		<dc:creator>Chris Heald</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[drb]]></category>
		<category><![CDATA[google talk]]></category>
		<category><![CDATA[jabber]]></category>
		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://www.coffeepowered.net/?p=19</guid>
		<description><![CDATA[Ever wanted to do IM from Rails? xmpp4r-simple makes it really easy to talk to Jabber clients (such as Google Talk users) from Ruby, but it&#8217;s not quite a cut-and-dried solution for your Rails apps. Fortunately, there&#8217;s Jabberish. Jabberish is a DRb-backed Jabber client designed for use in multi-server Rails apps. Just drop in the [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to do IM from Rails? <a href="http://code.google.com/p/xmpp4r-simple/">xmpp4r-simple</a> makes it really easy to talk to Jabber clients (such as <a href="http://www.google.com/talk/">Google Talk</a> users) from Ruby, but it&#8217;s not quite a cut-and-dried solution for your Rails apps. Fortunately, there&#8217;s <a href="http://github.com/cheald/jabberish/tree/master">Jabberish</a>.</p>
<p>Jabberish is a DRb-backed Jabber client designed for use in multi-server Rails apps. Just drop in the plugin, configure, start the daemon, and off you go.</p>
<p>Installation is painless, as you&#8217;d expect.</p>
<pre><code> script/plugin install git://github.com/cheald/jabberish.git</code></pre>
<p>Jabberish calls in your code will fail silently if the Jabberish DRb process isn&#8217;t running, so if the daemon goes missing, it won&#8217;t bring your app crashing down around your shoulders &#8211; you just won&#8217;t get IMs.</p>
<p>Once it&#8217;s installed, it&#8217;s very easy to get it up and running.</p>
<ol>
<li>Pop open <code>config/jabberish.yml</code> and set your preferences as you best see fit.</li>
<li>run <code>rake jabberish:start</code> &#8211; this will start up your DRb daemon, and connect to your configured account to your Jabber network</li>
<li>Call Jabberish from your code!</li>
</ol>
<pre class="brush: ruby; title: ; notranslate">
JabberishAgent.deliver(&quot;your-email@gmail.com&quot;, &quot;Hi there!&quot;)
</pre>
<p>There are many potential applications. For example, to send yourself IMs when your app has an error, in application.rb:</p>
<pre class="brush: ruby; title: ; notranslate">
def rescue_action(e)
  # The third parameter is &quot;throttle&quot;, which will cause Jabberish to refuse
  # to send the same message to a given recipient twice in a row
  msg = sprintf(&quot;[#%s] %s (%s)&quot;, Time.now.to_i, e, e.backtrace.first)
  JabberishAgent.deliver(&quot;your-email@gmail.com&quot;, msg, true)
end
</pre>
<p>And lickety split, you&#8217;re IMing error reports to yourself in realtime. I&#8217;m sure others will find much more interesting things to do with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coffeepowered.net/2008/09/25/jabberish-making-rails-talk-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

