<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ronin: Tag xmpp</title>
    <link>http://blogs.divisibleprime.com/ronin/articles/tag/xmpp</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stuff</description>
    <item>
      <title>Jabber Notification</title>
      <description>&lt;p&gt;A variation on the &lt;a href="http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification"&gt;Gnome Notification&lt;/a&gt; theme with some jabber.&lt;/p&gt;

&lt;p&gt;This time with some ruby:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/ruby
begin
  require 'rubygems'
  require 'xmpp4r/client'
rescue LoadError
  puts "Couldn't load xmpp4r, you probably need to install it.  Try gem install xmpp4r"
  exit
end

include Jabber
jid = JID::new('your_user@example.com')
password = 'xxx'
cl = Client::new(jid)
cl.connect
cl.auth(password)
to = "your_user@example.com"
subject = "Notification from `$USER`"
ARGV.each do | message |
   m = Message::new(to, message).set_type(:normal).set_id('1').set_subject(subject)
   cl.send m
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run it like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;emerge something_that_takes_ages; notify.rb "Emerge Done"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You&amp;#8217;ll need ruby, ruby gems, and the xmpp4r gem.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Mar 2009 19:24:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:78f3e060-c25f-4fc4-9bc6-c3785a6c2292</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2009/03/21/jabber-notification</link>
      <category>Tech</category>
      <category>Ruby</category>
      <category>linux</category>
      <category>ruby</category>
      <category>jabber</category>
      <category>xmpp</category>
      <category>notification</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/947</trackback:ping>
    </item>
  </channel>
</rss>
