<?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>Whomwah.com &#187; ejabberd</title>
	<atom:link href="http://whomwah.com/tag/ejabberd/feed/" rel="self" type="application/rss+xml" />
	<link>http://whomwah.com</link>
	<description>The website of Duncan Robertson, currently computing for the BBC</description>
	<lastBuildDate>Fri, 06 Jan 2012 12:55:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>BBC Programmes via Instant Messenger</title>
		<link>http://whomwah.com/2008/11/02/bbc-programmes-via-instant-messenger/</link>
		<comments>http://whomwah.com/2008/11/02/bbc-programmes-via-instant-messenger/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 15:04:58 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[ejabberd]]></category>
		<category><![CDATA[jabber]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=671</guid>
		<description><![CDATA[I have been playing with ejabberd, Jabber, XMPP and the various client libraries, specifically the rather wonderfully simple Jabber::Simple and Jabber:Bot. It all started because I was doing a Fireeagle integration job with a product at work, and was getting frustrated with the fact that it is still not super simple to update my location. [...]]]></description>
			<content:encoded><![CDATA[<p>I have been playing with <a href="http://www.ejabberd.im/">ejabberd</a>, <a href="http://www.jabber.org">Jabber</a>, <a href="http://xmpp.org/">XMPP</a> and the various client libraries, specifically the rather wonderfully simple <a href="http://xmpp4r-simple.rubyforge.org/">Jabber::Simple</a> and <a href="http://socket7.net/software/jabber-bot">Jabber:Bot</a>.</p>
<p>It all started because I was doing a <a href="http://fireeagle.yahoo.net/">Fireeagle</a> integration job with a <a href="http://radiopop.co.uk/">product</a> at <a href="http://bbc.co.uk/music">work</a>, and was getting frustrated with the fact that it is still not super simple to update my location. It struck me as I stared at my desktop, that I always have <a href="http://www.adiumx.com/">Adium</a> running. Wouldn&#8217;t it be great if I had a Fireeagle contact that I could just tell my location, and it would go off and update, letting me know when they&#8217;re done. Now that part is midway done (post to come), but before I started that, I wanted to research more the workings of a <a href="http://en.wikipedia.org/wiki/Chatterbot">Chatterbot</a>, a computer program that pretends to be a human and can answer basic commands. They have been around for a long time, I remember playing with an <a href="http://en.wikipedia.org/wiki/IRC_bot">IRC bot</a> a while back, getting it to display the last commit messages from <a href="http://subversion.tigris.org/">Subversion</a>.</p>
<p>So that research turned into a BBC Programmes bot. As I worked on <a href="http://www.bbc.co.uk/programmes">BBC Programmes</a>, I have good knowledge of the site and the data within, and building a bot that integrated with that data seemed a good example of using the <a href="http://www.bbc.co.uk/programmes/developers#alternateserialisations">restful API</a> available.</p>
<p>If you just want to try this thing out, here are the details of what you need to do.</p>
<ol>
<li>You need a <a href="http://mail.google.com/">Gmail</a> or Jabber compatible IM account</li>
<li>You need a <a href="http://www.jabber.org">Jabber</a> enabled client, I&#8217;ve listed a few:
<ul>
<li>Linx: <a href="http://pidgin.im/">Pidgin</a>, GTalk</li>
<li>Mac: <a href="http://www.apple.com/macosx/features/ichat.html">iChat</a>, Adium, <a href="http://psi-im.org/">Psi</a></li>
<li>Win: Psi, <a href="http://www.ceruleanstudios.com/">Trillian</a>, <a href="http://www.google.com/talk/">GTalk</a></li>
</ul>
</li>
<li>You need to add a new contact: <strong>im.bbcprogrammes@gmail.com</strong></li>
</ol>
<p>This should be it. You should have a new contact appear in your list (They have a <a href="http://www.bbc.co.uk/commissioning/tvbranding/usage.shtml">BBC logo</a> as an avatar). You can now begin a conversation with this contact. It&#8217;s probably best to start with:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">-&gt; ?
-&gt; help</pre></div></div>

<p><img src="http://farm4.static.flickr.com/3149/2990449504_9d5d12c494.jpg" alt="BBC Programmes IM Bot" /><span  class="caption">The help menu is your best starting point</span></p>
<p>You can get more detailed help on the various commands with:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">-&gt; ? upcoming
-&gt; ? schedule</pre></div></div>

<p>This should give you enough information to start making queries against the BBC Programmes data.</p>
<p class="note">[NOTE] I should say at this point, that this service is running on my own little <a href="http://www.slicehost.com/">virtual box</a>, and I don&#8217;t have the funds to have <a href="http://en.wikipedia.org/wiki/Deep_Blue_(chess_computer)">Deep Blue</a>, so the service may well fall over, or be a bit flaky if many people use it. I&#8217;m hoping to persuade <a href="http://bbc.co.uk">my bosses</a> to let me host this on the BBC infrastructure at some point, but until then be aware. The beauty of this kind of service though is that if it dies, your contact just goes offline. When the service is brought up again, the contact comes online. Nothing too drastic in other words.</p>
<p>So here&#8217;s a few fun commands to get you going:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># show what's currently on 6music
-&gt; now 6music
# show what's currently on radio4
-&gt; next radio4:fm
# show the BBC One London schedule
-&gt; schedule bbcone:london
# show the BBC One London schedule in detail
-&gt; schedule bbcone:london in full
# show upcoming programmes in the format Films available on BBC One in detail
# you can get a full formats list from: http://add.url.com 
-&gt; upcoming films on bbcone:london in full
# show upcoming programmes in the genre Drama/Soaps available in detail
# you can get a full genres list from: http://add.url.com 
-&gt; upcoming drama:soaps in full</pre></div></div>

<p><img src="http://farm4.static.flickr.com/3285/2990449318_53e3e2bf9c.jpg" alt="BBC Programmes IM bot" /><span  class="caption">Upcoming films on BBC Two</span></p>
<p>Hopefully you get the idea, and like I said the help page should give you all the information you need, specifically around getting hold of all the network names available to the bot.</p>
<p>I have a few ideas for future development, specifically around asking for things that you can watch via iPlayer. So you could ask:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">-&gt; available films on bbcone:london
-&gt; available eastenders</pre></div></div>

<p>This is in the pipeline, and I&#8217;ll just add the functionality as I get it finished, so keep an eye on the help page for more commands.</p>
<p>Much of the heavy carrying is handled but the brilliant <a href="http://socket7.net/software/jabber-bot">Jabber::Bot</a> written by <a href="http://socket7.net">Brett Stimmerman</a>. I&#8217;ve customised it slightly for my needs, by added the ability to <a href="http://daemons.rubyforge.org/">deamonize</a> it and also tweaks around the displaying of help information.</p>
<p>The work that remained was to build a &#8216;recipe&#8217; script that defines and handles all the incoming commands. There is currently no caching or optimisations, but you can get a copy of this to use yourself from:</p>
<ul>
<li><a href="http://code.whomwah.com/ruby/bbcbot">Download bbcbot from http://code.whomwah.com</a></li>
<li><a href="http://github.com/whomwah/code/tree/master/public/ruby/bbcbot">Download bbcbot from github</a></li>
</ul>
<p>You can just add the relevant configuration entries at the top of the script and then start in a way that suits you best. I have moved over to using <a href="http://cr.yp.to/daemontools.html">daemontools</a>, but you can still uncomment the relevant lines in the script (see comments) and use:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">-&gt; ./bbcbot start</pre></div></div>

<p>and bingo, you should now have your own BBC Programmes bot to communicate with.</p>
]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2008/11/02/bbc-programmes-via-instant-messenger/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

