<?xml version="1.0" encoding="UTF-8"?>
<posts type="array">
  <post>
    <body>&lt;p&gt;Sunday monday fun: &lt;a href=&quot;http://github.com/pengwynn/gowalla&quot;&gt;gowalla gem&lt;/a&gt;, &lt;a href=&quot;http://maps.google.com&quot;&gt;google maps&lt;/a&gt;, some Javascript stuff, and a Rails app.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://gowallamaps.heroku.com&quot;&gt;Gowalla spots Google Maps Mashup&lt;/a&gt; [http://gowallamaps.heroku.com]&lt;/p&gt;
&lt;p&gt;It tries to use HTML5 geo location to get a position on the map (defaults to somewhere on &lt;span class=&quot;caps&quot;&gt;USA&lt;/span&gt;). Probably best used on the iphone (tried on a friend&amp;#8217;s Android and it failed :S). Screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://0x82.blog.s3.amazonaws.com/01032010/gowalla.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Simple hack, and a reminder for &lt;a href=&quot;http://www.gowalla.com&quot;&gt;Gowalla&lt;/a&gt; to open up their &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; :) Thnks @pengwynn for the awesome gem :)&lt;/p&gt;</body>
    <excerpt nil="true"></excerpt>
    <id type="integer">129</id>
    <permalink>gowalla-spots-google-maps-mashup</permalink>
    <published-at type="datetime">2010-03-01T09:29:00-08:00</published-at>
    <title>Gowalla spots Google Maps mashup</title>
  </post>
  <post>
    <body>&lt;p&gt;&lt;a href=&quot;http://activitystrea.ms/&quot;&gt;ActivityStreams&lt;/a&gt; is the next big thing &lt;sup&gt;TM&lt;/sup&gt;. It defines a protocol to syndicate activities taken from web applications (mainly social ones) and services. Just imagine a common spec for describing the activities a user do on Facebook, FriendFeed, Delicious, etc.&lt;/p&gt;
&lt;p&gt;The protocol originally targeted the Atom &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt; Standard, via an extension. Later, some work has been done on standardizing a &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; format too.&lt;/p&gt;
&lt;p&gt;With that in mind, I&amp;#8217;ve tried to implement a Ruby parser that defines a common &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; to access both the Atom and the &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; specification. Is is now available on &lt;a href=&quot;http://github.com/webcracy/activity_streams&quot;&gt;github&lt;/a&gt; and also as a &lt;a href=&quot;http://rubygems.org/gems/activity_streams&quot;&gt;Ruby gem&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a simple demonstration on how it works. We take the excellent &lt;a href=&quot;http://feedproxy.cliqset.com/&quot;&gt;Cliqset feed proxy&lt;/a&gt; and get an activity streams annotated Twitter Atom feed:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/314594.js?file=activity_streams_example.rb&quot;&gt;&lt;/script&gt;&lt;p&gt;The &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; is very similar. Some documentation is up on &lt;a href=&quot;http://rdoc.info/projects/webcracy/activity_streams&quot;&gt;rdoc.info&lt;/a&gt; and it is worth checking the spec too. Have fun :)&lt;/p&gt;</body>
    <excerpt nil="true"></excerpt>
    <id type="integer">128</id>
    <permalink>activitystreams-ruby-parser-gem</permalink>
    <published-at type="datetime">2010-02-25T07:02:00-08:00</published-at>
    <title>ActivityStreams parser Ruby gem</title>
  </post>
  <post>
    <body>&lt;p&gt;HTML5 is here! Urray!&lt;/p&gt;
&lt;p&gt;I was tired of hearing about one of the new innovation in HTML5: the &lt;a href=&quot;http://dev.w3.org/html5/websockets/&quot;&gt;WebSocket &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After reading the excelent blog post about &lt;a href=&quot;http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/&quot;&gt;WebSockets and Ruby&lt;/a&gt; by Ilya Grigorik I got inspired by &lt;a href=&quot;http://rfw.posterous.com/musictweets-a-rediswebsocket-powered-experime&quot;&gt;this experiment&lt;/a&gt; which is a simple example of a &lt;em&gt;twitter-to-browser&lt;/em&gt; usage of websockets.&lt;/p&gt;
&lt;p&gt;Since the excelent &lt;a href=&quot;http://github.com/igrigorik/em-websocket&quot;&gt;em-websocket&lt;/a&gt; was available on github, I decided to write my own &amp;#8220;from twitter to the browser&amp;#8221; real time updates, with no polling.&lt;/p&gt;
&lt;p&gt;You can check the final result on &lt;a href=&quot;http://github.com/rubenfonseca/twitter-amqp-websocket-example&quot;&gt;my github repo&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;General overview&lt;/h3&gt;
&lt;p&gt;Twitter Stream &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; &amp;#8594; Filter &amp;#8594; RabbitMQ &amp;#8594; &lt;span class=&quot;caps&quot;&gt;AMQP&lt;/span&gt; &amp;#8594; Eventmachine &amp;#8594; WebSocket &amp;#8594; HTML5 Brwser&lt;/p&gt;
&lt;p&gt;Too much buzzwords? Lets look at some code.&lt;/p&gt;
&lt;h3&gt;Filter&lt;/h3&gt;
&lt;p&gt;The filter is responsible for eating the &lt;a href=&quot;http://apiwiki.twitter.com/Streaming-API-Documentation&quot;&gt;Twitter Stream &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/a&gt; and puting the tweets on a queue (RabbitMQ in my case) using &lt;span class=&quot;caps&quot;&gt;AMQP&lt;/span&gt;:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/264450.js?file=gistfile1.rb&quot;&gt;&lt;/script&gt;&lt;p&gt;Pretty easy right? Notice I am using a fanout exchange, which will allow me to broadcast the same message to all queues (clients) latter on.&lt;/p&gt;
&lt;h3&gt;Server&lt;/h3&gt;
&lt;p&gt;Now we just need to build a server that accepts websocket connections, and for each client deliver each message that arrives on the fanout exchange. The code will make this clear:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/264453.js?file=gistfile1.rb&quot;&gt;&lt;/script&gt;&lt;p&gt;So simple, yet so awesome!&lt;/p&gt;
&lt;h3&gt;Client&lt;/h3&gt;
&lt;p&gt;The client just have to connect the websocket, and for each &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; piece that arrives on the socket, present them on the screen:&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/264454.js?file=gistfile1.js&quot;&gt;&lt;/script&gt;&lt;p&gt;It seems we&amp;#8217;ve ended writing almost more JS than Ruby :P Note that I&amp;#8217;ve only tested this on Webkit nightly and latest Google Chrome beta for Mac.&lt;/p&gt;
&lt;p&gt;Overall it was a great and easy experience building this simple system, but it allowed me to realize how simple we can build scalable push systems with the WebSocket &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;: seems like &lt;a href=&quot;http://twitter.com/igrigorik/status/7107086085&quot;&gt;Ilya Grigorik liked it&lt;/a&gt; :)&lt;/p&gt;</body>
    <excerpt nil="true"></excerpt>
    <id type="integer">126</id>
    <permalink>twitter-amqp-websocket-example-no-polling</permalink>
    <published-at type="datetime">2009-12-28T10:18:00-08:00</published-at>
    <title>Twitter AMQP WebSocket Example (no polling)</title>
  </post>
  <post>
    <body>&lt;p&gt;quick post to let you know my latest two mini-projects on &lt;a href=&quot;http://www.github.com&quot;&gt;github&lt;/a&gt;:&lt;/p&gt;
&lt;h3&gt;Ruby library to whit.me service &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://whit.me&quot;&gt;whit.me&lt;/a&gt; is a wonderful service to shorten URLs. They have a &lt;a href=&quot;http://www.whit.me/api/docs&quot;&gt;public &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;&lt;/a&gt;, and I wrote this library that allows you to use the service in the middle of any Ruby script.&lt;/p&gt;
&lt;p&gt;The project is available &lt;a href=&quot;http://github.com/rubenfonseca/whitme/tree/master&quot;&gt;here&lt;/a&gt;. It is compatible with Ruby 1.9 and JRuby, and contains a full RSpec test suite.&lt;/p&gt;
&lt;h3&gt;newzbin &lt;span class=&quot;caps&quot;&gt;XMPP&lt;/span&gt; search agent&lt;/h3&gt;
&lt;p&gt;After spending some time learning &lt;a href=&quot;http://xmpp.org&quot;&gt;&lt;span class=&quot;caps&quot;&gt;XMPP&lt;/span&gt;&lt;/a&gt;, I decided to try it and build something useful. So I hacked a simple search agent for the &lt;a href=&quot;http://newzbin.com&quot;&gt;newzbin&lt;/a&gt; website to be used by me and my friends. It is poorly written, but it works.&lt;/p&gt;
&lt;p&gt;Maybe you can learn something from the simple example. In case you&amp;#8217;re  interested, the code is available &lt;a href=&quot;http://github.com/rubenfonseca/newzbin_xmpp/tree/master&quot;&gt;again on github&lt;/a&gt;. It uses the XMPP4R gem and CouchDB (overkill, I know).&lt;/p&gt;
&lt;p&gt;Feel free to comment on any of the code and send me suggestions on how to  improve it.&lt;/p&gt;</body>
    <excerpt nil="true"></excerpt>
    <id type="integer">123</id>
    <permalink>two-more-contributions-to-the-open-source-world</permalink>
    <published-at type="datetime">2009-05-22T14:22:00-07:00</published-at>
    <title>Two more contributions to the open source world</title>
  </post>
  <post>
    <body>&lt;p&gt;Together with &lt;a href=&quot;http://whythehype.com/&quot;&gt;Tiago Pinto&lt;/a&gt; I&amp;#8217;ve completed a &lt;a href=&quot;http://www.tarpipe.com&quot;&gt;TarPipe&lt;/a&gt; &lt;a href=&quot;http://tarpipe.rubyforge.org&quot;&gt;API for Ruby&lt;/a&gt;.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;tarpipe is a publishing mediation and distribution platform that simplifies regular upload activities&lt;/p&gt;
	&lt;/blockquote&gt;

	&lt;p&gt;The gem is available &lt;a href=&quot;http://tarpipe.rubyforge.net&quot;&gt;here&lt;/a&gt; and the sources are on &lt;a href=&quot;http://github.com/rubenfonseca/tarpipe-ruby/tree/master&quot;&gt;github&lt;/a&gt;. It is my first released gem so feel free to send some tips and suggestions.&lt;/p&gt;


	&lt;p&gt;TarPipe is currently evolving very fast so me and Tiago will make sure our library stays up to date. Have fun doing your uploads!&lt;/p&gt;</body>
    <excerpt nil="true"></excerpt>
    <id type="integer">105</id>
    <permalink>tarpipe-ruby-api</permalink>
    <published-at type="datetime">2008-05-20T06:21:00-07:00</published-at>
    <title>TarPipe Ruby API</title>
  </post>
</posts>
