<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>Robby on Rails: The new RubyURL API</title>
    <link>http://www.robbyonrails.com/articles/2008/08/31/the-new-rubyurl-api</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>The new RubyURL API</title>
      <description>&lt;p&gt;We&amp;#8217;ve just deployed the initial version of an &lt;a href="http://rubyurl.com/api"&gt;&lt;span class="caps"&gt;API&lt;/span&gt; for RubyURL&lt;/a&gt;. It makes it really easy to create RubyURLs and is now open to the public. Should it end up being abused, we&amp;#8217;ll consider introducing an &lt;span class="caps"&gt;API KEY&lt;/span&gt; for authenticating and tracking abuse.&lt;/p&gt;


	&lt;p&gt;In the meantime, you can now start to use the RubyURL &lt;span class="caps"&gt;API&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;For example, the following&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ curl  -i \ 
        -X POST \
        -H 'Content-Type: application/xml' \
        -d '&amp;lt;link&amp;gt;&amp;lt;website_url&amp;gt;http://github.com/robbyrussell&amp;lt;/website_url&amp;gt;&amp;lt;/link&amp;gt;' \
        http://rubyurl.com/api/links  
&lt;/code&lt;/pre&gt;

	&lt;p&gt;...would return the following response.&lt;/p&gt;


&lt;script src="http://gist.github.com/8207.js"&gt;&lt;/script&gt;

	&lt;p&gt;I&amp;#8217;ll be updating the &lt;a href="http://github.com/robbyrussell/shorturl/tree/master"&gt;ShortURL gem&lt;/a&gt; in the coming days (unless someone else wants to patch it first &lt;strong&gt;wink&lt;/strong&gt;) to take advantage of new &lt;span class="caps"&gt;API&lt;/span&gt;, versus how it&amp;#8217;s currently creating RubyURLs.&lt;/p&gt;


	&lt;p&gt;You can see the code &amp;amp; changes for this new &lt;span class="caps"&gt;API&lt;/span&gt; on the &lt;a href="http://github.com/robbyrussell/rubyurl/commits/master"&gt;RubyURL github site&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Update with &lt;span class="caps"&gt;JSON&lt;/span&gt;&lt;/h3&gt;


	&lt;p&gt;I took a little time today to update the &lt;span class="caps"&gt;API&lt;/span&gt; and extend it to support &lt;span class="caps"&gt;JSON&lt;/span&gt;. So&amp;#8230; you can now use the RubyURL &lt;span class="caps"&gt;API&lt;/span&gt; to generate RubyURLs via &lt;span class="caps"&gt;JSON&lt;/span&gt;. (see &lt;a href="http://github.com/robbyrussell/rubyurl/commit/36bcd0716a0a86fdaaf352d7760653b886877f2e"&gt;commits&lt;/a&gt;)&lt;/p&gt;


&lt;script src="http://gist.github.com/8363.js"&gt;&lt;/script&gt;

	&lt;p&gt;Enjoy! If you&amp;#8217;re using RubyURL via the new &lt;span class="caps"&gt;API&lt;/span&gt;, I&amp;#8217;d love to hear about it. :-)&lt;/p&gt;
</description>
      <pubDate>Sun, 31 Aug 2008 13:55:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f47bfa0b-c16e-4e8c-ba67-1a220f158d08</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/08/31/the-new-rubyurl-api</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>api</category>
      <category>REST</category>
      <category>xml</category>
      <category>rubyurl</category>
      <category>development</category>
    </item>
  </channel>
</rss>
