<?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/"
	xmlns:georss="http://www.georss.org/georss" >

<channel>
	<title>Even the wrong words seem to rhyme &#187; api</title>
	<atom:link href="http://www.kevinblake.co.uk/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kevinblake.co.uk</link>
	<description>a blog-life by Kevin Blake</description>
	<lastBuildDate>Thu, 13 May 2010 22:27:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Wave &#8211; My First Bot</title>
		<link>http://www.kevinblake.co.uk/google-wave-my-first-bot/706/</link>
		<comments>http://www.kevinblake.co.uk/google-wave-my-first-bot/706/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 21:31:37 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[googe wave]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[wave]]></category>
		<category><![CDATA[wave robot]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=706</guid>
		<description><![CDATA[Last week, I went to the Google Technology User Group in London, which was all on the subject of Google Wave.  Lars and Steph, of Google Wave video, and Google Maps fame gave an excellent talk on Wave, how it was doing, where it was going, and the challenges they&#8217;re still facing in getting Wave [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I went to the Google Technology User Group in London, which was all on the subject of Google Wave.  Lars and Steph, of Google Wave video, and Google Maps fame gave an excellent talk on Wave, how it was doing, where it was going, and the challenges they&#8217;re still facing in getting Wave ready for prime time and a public release.</p>
<p>I&#8217;ve had a developer account for some time now, and the talk finally got me motivated into messing around with more of the APIs.  So I created a bot.  Then I created another one.  Because the first one didn&#8217;t do anything.</p>
<p><strong>1.  Get Eclipse</strong></p>
<p>So far, the choices for creating Google bots are rather limited because there are rules that they must be hosted on AppEngine (for now).   So first off, get Eclipse &#8211; because it makes the entire process of doing that incredibly easy.  You can <a href="http://www.eclipse.org/downloads/" target="_blank">download Eclipse here</a>.</p>
<p><strong>2.  Get the AppEngine SDK.</strong></p>
<p>Once you&#8217;ve got Eclipse installed and running, go to Help -&gt; Install New Software.  Enter this URL to get at the Google AppEngine SDK.</p>
<pre>http://dl.google.com/eclipse/plugin/3.5</pre>
<p><strong>3.  Create your project.</strong></p>
<p>Go to File-&gt;New, and select Web Application Project.  If you don&#8217;t have that option, something&#8217;s gone wrong with your SDK download, so check step 2.</p>
<p>Uncheck the Googe Web Toolkit, we don&#8217;t need that.  But otherwise fill out the Project Name and Package as you see fit.</p>
<p><strong>4.  Add the libraries from the <a href="http://code.google.com/p/wave-robot-java-client/" target="_blank">Wave extensions SDK</a></strong></p>
<p>Download wave-robots-api.jar, json.jar, and jsonrpc.jar and drop those into your project under war/WEB-INF/lib/.</p>
<p>Once you&#8217;ve done that, select File-&gt;Refresh, then Project-&gt;Properties from the main menu, and select Java Build Path.  Click Libraries, and Add JARs, to select the three that you&#8217;ve just added.</p>
<p><strong>5.  Write your servlet class.</strong></p>
<p>This is where the bulk of your bot logic (or lack of it), goes.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">package</span> <span class="co2">helloworld</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">com.google.wave.api.*</span><span class="sy0">;</span>
<span class="kw1">public</span> <span class="kw1">class</span> HelloWorldServlet <span class="kw1">extends</span> AbstractRobotServlet <span class="br0">&#123;</span>
	<span class="kw1">public</span> <span class="kw4">void</span> processEvents<span class="br0">&#40;</span>RobotMessageBundle bundle<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="kw1">for</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Event</span></a> e<span class="sy0">:</span> bundle.<span class="me1">getEvents</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
			<span class="kw1">if</span> <span class="br0">&#40;</span>e.<span class="me1">getType</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> EventType.<span class="me1">BLIP_SUBMITTED</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
			Blip blip <span class="sy0">=</span> e.<span class="me1">getBlip</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">createChild</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
			TextView textView <span class="sy0">=</span> blip.<span class="me1">getDocument</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
			textView.<span class="me1">append</span><span class="br0">&#40;</span><span class="st0">&quot;Hello.  Are you the world?&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
			<span class="kw1">break</span><span class="sy0">;</span>
			<span class="br0">&#125;</span>
		<span class="br0">&#125;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
<p><strong>6.  Add a servlet mapping.</strong></p>
<p>Edit the file, war/WEB-INF/web.xml and add a servet-mapping just below the one you have already.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;servlet-mapping<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;servlet-name<span class="re2">&gt;</span></span></span>HelloWorld<span class="sc3"><span class="re1">&lt;servlet-name<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;url-pattern<span class="re2">&gt;</span></span></span>/_wave/robot/jsonrpc<span class="sc3"><span class="re1">&lt;/url-pattern<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/servlet-mapping<span class="re2">&gt;</span></span></span></pre></div></div>
<p><strong>7.  Add a capabilities file.</strong></p>
<p>Add a folder under war/_wave.  Create a file under that called capabilities.xml.  This tells Wave which events your robot is going to respond to.  In our case, we&#8217;re going to respond whenever a blip is saved (blip_submitted)./  There is a <a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/com/google/wave/api/EventType.html" target="_blank">full list of capabilities</a> in the full api docs.</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="xml" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;utf-8&quot;</span><span class="re2">?&gt;</span></span>
<span class="sc3"><span class="re1">&lt;w:robot</span> <span class="re0">xmlns:w</span>=<span class="st0">&quot;http://wave.google.com/extensions/robots/1.0&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;w:capabilities<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;w:capability</span> <span class="re0">name</span>=<span class="st0">&quot;BLIP_SUBMITTED&quot;</span> <span class="re0">content</span>=<span class="st0">&quot;true&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/w:capabilities<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;w:version<span class="re2">&gt;</span></span></span>3<span class="sc3"><span class="re1">&lt;/w:version<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/w:robot<span class="re2">&gt;</span></span></span></pre></div></div>
<p><strong>8.  Get an AppEngine account.</strong></p>
<p>That kind of finishes off the Wave-bot.  So you&#8217;ll need an <a href="http://appengine.google.com/" target="_blank">AppEngine account</a> to continue.  So go ahead and sign up, and create an application.  Incidently, I couldn&#8217;t find my created apps since I have a Google Apps / Domain account.  if that&#8217;s the case for you as well, you can find your apps list at http://appengine.google.com/a/&lt;domain&gt;.  Not sure why Google don&#8217;t detect that, but there we go.</p>
<p><strong>9.  Deploy to AppEngine</strong></p>
<p>Click the friendly little icon <a href="http://www.kevinblake.co.uk/wp-content/uploads/2009/11/ae_deploy_button.png" rel="lightbox"><img class="size-full wp-image-709 alignnone" title="ae_deploy_button" src="http://www.kevinblake.co.uk/wp-content/uploads/2009/11/ae_deploy_button.png" alt="ae_deploy_button" width="22" height="22" /></a> from your Eclipse toolbar, and enter your details to deploy you new robot.  Try not to scream &#8220;fly my pretties&#8221; as you do so.  I dare you.  Make sure you click the App Engine Project Settings button, and provide you Application ID, the same as you created in step 8.</p>
<p><strong>10.  Add your app to a wave</strong></p>
<p>The address of your robot will be <em>applicationid</em>@appspot.com, and you can add it just like any other robot.</p>
<p>You should now be able to interact with your bot.</p>
<p><a href="http://www.kevinblake.co.uk/wp-content/uploads/2009/11/bot1.JPG" rel="lightbox"><img class="size-full wp-image-711 alignnone" title="bot" src="http://www.kevinblake.co.uk/wp-content/uploads/2009/11/bot1.JPG" alt="bot" width="459" height="307" /></a></p>
<p>And if you&#8217;d like to see my first bot in action &#8211; please drop in and say hello by adding it to your wave: <em><strong>insulteveryone@appspot.com</strong></em>.</p>
<p>Now. World peace.  Where did I leave that file?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/google-wave-my-first-bot/706/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Wave &#8211; Embedding for the first time</title>
		<link>http://www.kevinblake.co.uk/google-wave-embedding-for-the-first-time/701/</link>
		<comments>http://www.kevinblake.co.uk/google-wave-embedding-for-the-first-time/701/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 06:53:25 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[programmning]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=701</guid>
		<description><![CDATA[This is the first of the embedded Waves using the embed api (embeddy@appspot.com).  If you&#8217;re in the Wave, you can add comments to this one and see them both here, and on my blog.  This really demonstrates a lot of the appeal of Wave for me.  Although it&#8217;s a bit chicken-and-egg, as it&#8217;s still in [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first of the embedded Waves using the embed api (embeddy@appspot.com).  If you&#8217;re in the Wave, you can add comments to this one and see them both here, and on my blog.  This really demonstrates a lot of the appeal of Wave for me.  Although it&#8217;s a bit chicken-and-egg, as it&#8217;s still in a relatively closed beta.  So if you can&#8217;t see anything below, and you don&#8217;t have a Wave account.  Sorry <img src='http://www.kevinblake.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="waveframe-dyx36Zd8A" style="width: 100; height: 200px"></div>
<p>If you want to do the same sort of thing, just add embeddy@appspot.com to any Wave, and you can get your hands on some embed code, and your Wave ID.  Cool, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/google-wave-embedding-for-the-first-time/701/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gallery2 remote API C# wrapper</title>
		<link>http://www.kevinblake.co.uk/gallery2-remote-api-c-wrapper/586/</link>
		<comments>http://www.kevinblake.co.uk/gallery2-remote-api-c-wrapper/586/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 17:59:22 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[gallery2]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.kevinblake.co.uk/?p=586</guid>
		<description><![CDATA[I stumbled across the Gallery.NET Toolkit on Twitter, while I should have been doing something more useful; some great work from @rmaclean (thanks for sharing / codeplexing  it). The API wraps up a lot of the Gallery2 remote services into some easy to use C# functions. Hopefully I&#8217;ll find an excuse to use this one day.]]></description>
			<content:encoded><![CDATA[<p>I stumbled across the <a href="http://gallery2.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29252" target="_blank">Gallery.NET Toolkit</a> on Twitter, while I should have been doing something more useful; some great work from <a href="http://www.twitter.com/rmaclean" target="_blank">@rmaclean</a> (thanks for sharing / codeplexing  it).</p>
<p>The API wraps up a lot of the Gallery2 remote services into some easy to use C# functions.</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.kevinblake.co.uk/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="csharp" style="font-family:monospace;">Actions a <span class="sy0">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span class="kw3">new</span></a> SADev.<span class="me1">Gallery2</span>.<span class="me1">Protocol</span>.<span class="me1">Actions</span><span class="br0">&#40;</span><span class="st0">&quot;http://www.blakepics.com&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw4">string</span> authToken <span class="sy0">=</span> a.<span class="me1">Login</span><span class="br0">&#40;</span><span class="st0">&quot;*************&quot;</span>, <span class="st0">&quot;*************&quot;</span><span class="br0">&#41;</span>.<span class="me1">AuthToken</span><span class="sy0">;</span>
a.<span class="me1">FetchAlbums</span><span class="br0">&#40;</span>authToken<span class="br0">&#41;</span>.<span class="me1">Albums</span>.<span class="kw1">ForEach</span><span class="br0">&#40;</span>
    album <span class="sy0">=&gt;</span>
    <span class="br0">&#123;</span>
        Console.<span class="me1">WriteLine</span><span class="br0">&#40;</span>album.<span class="me1">Title</span><span class="br0">&#41;</span><span class="sy0">;</span>
        a.<span class="me1">FetchImages</span><span class="br0">&#40;</span>authToken, album.<span class="me1">Name</span><span class="br0">&#41;</span>.<span class="me1">Images</span>.<span class="kw1">ForEach</span><span class="br0">&#40;</span>image <span class="sy0">=&gt;</span>
            Console.<span class="me1">WriteLine</span><span class="br0">&#40;</span><span class="st0">&quot;<span class="es0">\t</span>&quot;</span> <span class="sy0">+</span> image.<span class="me1">Url</span><span class="br0">&#41;</span>
        <span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
    <span class="br0">&#41;</span><span class="sy0">;</span>
Console.<span class="me1">ReadKey</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>Hopefully I&#8217;ll find an excuse to use this one day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevinblake.co.uk/gallery2-remote-api-c-wrapper/586/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
