<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>Rob Ares</title>
 <link href="http://www.robares.com/atom.xml" rel="self" />
 <updated>2009-11-07T19:37:34-08:00</updated>
 <id>http://www.robares.com/</id>
 <author>
   <name>Rob Ares</name>
   <email>rob.ares@gmail.com</email>
 </author>

 
 <entry>
   <title>Rails Rumble 2009 Entry - a.ppend.to</title>
   <link href="http://www.robares.com/2009/08/24/rails-rumble-2009-entry-a.ppend.to.html" />
   <updated>2009-08-24T00:00:00-07:00</updated>
   <id>http://www.robares.com/2009/08/24/rails-rumble-2009-entry-a.ppend.to</id>
   <content type="html">  &lt;h1&gt;Rails Rumble 2009 Entry - a.ppend.to&lt;/h1&gt;

  &lt;p&gt;
   Over the weekend, I had the privilege of competing with &lt;a href=&quot;http://r09.railsrumble.com/teams/scatapult&quot; target=&quot;_blank&quot;&gt;Scatapult&lt;/a&gt; in this year's Rails Rumble. I had an absolute blast working with &lt;a href=&quot;http://twitter.com/reagent&quot;&gt;Pat&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/tpitale&quot;&gt;Tony&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/averyvery&quot;&gt;Doug&lt;/a&gt; this time around and 
it goes without saying that everyone was on their game.
  &lt;/p&gt;
  
  &lt;p&gt;
  a.ppend.to's description:
  &lt;blockquote&gt;
    Microblogging? How about Macroblogging? Use the power of Twitter to create a media-rich personal blog from just 140 characters of text.

    Simply send an @reply via Twitter to us (@ppend) and we'll do the rest. We recognize different types of content including photos, videos, mp3 audio, quotes, and more - so start posting!
  &lt;/blockquote&gt;
  &lt;/p&gt;
  &lt;p&gt;
  Please check &lt;a href=&quot;http://a.ppend.to&quot; target=&quot;_blank&quot;&gt;it&lt;/a&gt; out when it goes to public voting next week and vote for us on our  &lt;a href=&quot;http://r09.railsrumble.com/teams/scatapult&quot; target=&quot;_blank&quot;&gt;team page&lt;/a&gt;.
  &lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Using the Twitter Streaming API in Ruby</title>
   <link href="http://www.robares.com/2009/07/14/streaming-twitter-api.html" />
   <updated>2009-07-14T00:00:00-07:00</updated>
   <id>http://www.robares.com/2009/07/14/streaming-twitter-api</id>
   <content type="html">  &lt;h1&gt;Using the Twitter Streaming API with Ruby&lt;/h1&gt;

  &lt;p&gt;
    I have been researching the &lt;a href=&quot;http://apiwiki.twitter.com/Streaming-API-Documentation&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Twitter Streaming API&lt;/a&gt; recently for a side project (secret) and was playing around with it in Ruby to get a feel for how it works. I started out using an &lt;a href=&quot;http://github.com/igrigorik/em-http-request/tree/master&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;asynchronous http client&lt;/a&gt; to take advantage of the API but wound up having some issues with how it was chunking json as a response type (.xml was fine).
  &lt;/p&gt;
  &lt;p&gt;
    I wound up stumbling upon Brian Lopez's &lt;a href=&quot;http://github.com/brianmario/yajl-ruby/tree/master&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;yajl-ruby&lt;/a&gt; which is a ruby binding for a native streaming json library. It has excellent support for dealing with streams and also supports persistent http connections (perfect for the streaming API).
  &lt;/p&gt;
 
  &lt;p&gt;
    Below is some code utilizing yajl that opens a connection and pushes the screen name and text of a tweet to the console as it is received. (disclaimer: This is not even close to being production-ready as Twitter has strong recommendations for reconnect logic and dealing with the API's alpha QOS). This is using the publicly available sprinkler stream; which is only a subsection of the public timeline but should be good enough for general application use (there are gardenhose and firehose streams available for statistical purposes but access to these is at Twitter's discretion).
  &lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;uri&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;yajl/http_stream&amp;quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;twitter username here&amp;quot;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;twitter password here&amp;quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;URI&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;http://&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@stream.twitter.com/spritzer.json&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Yajl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;HttpStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:symbolize_keys&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;has_key?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:delete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;screen_name: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;][&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:screen_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;message: &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
  And that is it. I can point out that the streams will additionally push delete operations out that are to be honored by client applications. Above I am filtering out the delete messages by key name and only printing out actual statuses.
&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Hello World</title>
   <link href="http://www.robares.com/2009/03/26/first-post.html" />
   <updated>2009-03-26T00:00:00-07:00</updated>
   <id>http://www.robares.com/2009/03/26/first-post</id>
   <content type="html">
&lt;h1&gt;First Post&lt;/h1&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;hello world&amp;quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;</content>
 </entry>
 
 
</feed>