<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Web Development</title>
  <link href="http://benlund.info/log/Web_Development/atom" rel="self"/>
  <link href="http://benlund.info/log/Web_Development" rel="alternate"/>
  <id>http://benlund.info/log/Web_Development/atom</id>
  <updated>2007-01-30T22:34:57Z</updated>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Connotea To Del.icio.us</title>
  <link href="http://benlund.info/2007/01/30/contodel" rel="alternate"/>
  <link href="http://benlund.info/2007/01/30/contodel/atom" rel="edit"/>
  <id>http://benlund.info/2007/01/30/contodel</id>
  <updated>2007-01-30T22:34:57Z</updated>
  <published>2007-01-30T22:34:57Z</published>
  <author>
    <name>Ben Lund</name>
  </author>
  <category term="web_development" label="Web Development"/>
  <category term="main" label="Front Page"/>
  <summary type="html">

    &amp;lt;p&amp;gt; I wanted to import all my &amp;lt;a href=&amp;quot;http://www.connotea.org/user/ben&amp;quot;&amp;gt;Connotea bookmarks&amp;lt;/a&amp;gt; into &amp;lt;a href=&amp;quot;http://del.icio.us/benlund&amp;quot;&amp;gt;my Del.icio.us account&amp;lt;/a&amp;gt; for a small experiment I was running. So I glued together the two APIs with a simple Ruby script. &amp;lt;/p&amp;gt;

    </summary>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">

      <p> I wanted to import all my <a href='http://www.connotea.org/user/ben'>Connotea bookmarks</a> into <a href='http://del.icio.us/benlund'>my Del.icio.us account</a> for a small experiment I was running. So I glued together the two APIs with a simple Ruby script. </p>
<p> The script uses the <a href='http://ridiculous.rubyforge.org/'>Ridiculous</a> wrapper for the <a href='http://del.icio.us/help/api/'>Del.icio.us API</a> and my own <a href='http://www.connotea.org/wiki/WWWConnoteaRuby'>www-connotea-ruby</a> for the <a href='http://www.connotea.org/wiki/WebAPI'>Connotea Web API</a>. </p>
<p> I had problems installing Ridiculous from Rubygems, so I pulled it down from the SVN repository <pre>
    $ svn co svn://rubyforge.org//var/svn/ridiculous/0.5
  </pre> I had to patch ridiculous.rb with <a href='/static/ridiculous_v05_patch.patch'>this</a>. </p>
<p> I <a href='http://prdownloads.sourceforge.net/connotea/www-connotea-ruby-0.1.tar.gz?download'>downloaded www-connotea-ruby</a> and extracted it <pre>
    $ tar xvzf www-connotea-ruby-0.1.tar.gz
  </pre> And the connecting glue was just a few lines: </p>
<div class='code'><pre>
<span class='comment-delimiter'>#</span><span class='comment'>!/usr/bin/env ruby
</span>
<span class='comment-delimiter'># </span><span class='comment'>contodel.rb
</span><span class='comment-delimiter'># </span><span class='comment'>by Ben Lund, Jan 2007
</span>
<span class='comment-delimiter'># </span><span class='comment'>Usage: ruby contodel.rb connotea_username:connotea_password delicious_username:delicious_password
</span>
require <span class='string'>&#39;0.5/ridiculous&#39;</span>
require <span class='string'>&#39;www-connotea-ruby-0.1/lib/www/connotea&#39;</span>

c_user, c_pass = *<span class='type'>ARGV</span>.shift.split(<span class='string'>/:/</span>)
<span class='type'>Ridiculous</span>::<span class='type'>USERNAME</span>, <span class='type'>Ridiculous</span>::<span class='type'>PASSWORD</span> = *<span class='type'>ARGV</span>.shift.split(<span class='string'>/:/</span>)

c = <span class='type'>WWW</span>::<span class='type'>Connotea</span>.new(<span class='constant'>:user</span> =&#62; c_user, <span class='constant'>:password</span> =&#62; c_pass)

c.posts_for(<span class='constant'>:user=</span>&#62; c_user) <span class='keyword'>do</span> |p|
  success = <span class='variable-name'>false</span>
  <span class='keyword'>begin</span>
    success = <span class='type'>Ridiculous</span>::<span class='type'>Post</span>.new.add(
      <span class='constant'>:url</span> =&#62; p.link,
      <span class='constant'>:description</span> =&#62; p.title || p.link,
      <span class='constant'>:extended</span> =&#62; p.description,
        <span class='comment-delimiter'># </span><span class='comment'>Convert multi-word tags to underscore-separated</span>
        <span class='comment-delimiter'># </span><span class='comment'>And convert all to lowercase to overcome case-insensitivity 
  </span>
      <span class='constant'>:tags</span> =&#62; p.tags.map{|t| t.gsub(<span class='string'>/\s+/</span>, <span class='string'>&#39;_&#39;</span>).downcase }.join(<span class='string'>&#39; &#39;</span>) )
  <span class='keyword'>end</span>
  <span class='keyword'>raise</span> <span class='string'>&#34;Couldn&#39;t post </span><span class='variable-name'>#{p.link}</span><span class='string'>&#34;</span> <span class='keyword'>unless</span> success

  <span class='comment-delimiter'>#</span><span class='comment'>give the del.icio.us server a rest</span>
  sleep(1)
<span class='keyword'>end</span>
</pre></div>
<p class='update'> Update: Via <a href='http://www.ghastlyfop.com/blog/2007/02/delicious-to-connotea-mk2.html'>Stew</a>, a <a href='http://www2.informatik.hu-berlin.de/%7Ebaierer/src/diu2con.pl'>script</a> to go back the other way from <a href='http://www2.informatik.hu-berlin.de/%7Ebaierer/projekte.php'>Konstantin Baierer</a>. </p>
        </div>
  </content>
</entry>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="html">An Online Reference Shelf Using Del.icio.us and Firefox</title>
  <link href="http://benlund.info/2007/02/10/delicious-reference-shelf" rel="alternate"/>
  <link href="http://benlund.info/2007/02/10/delicious-reference-shelf/atom" rel="edit"/>
  <id>http://benlund.info/2007/02/10/delicious-reference-shelf</id>
  <updated>2007-02-10T14:08:56Z</updated>
  <published>2007-02-10T14:08:56Z</published>
  <author>
    <name>Ben Lund</name>
  </author>
  <category term="main" label="Front Page"/>
  <category term="web_development" label="Web Development"/>
  <category term="del.icio.us"/>
  <category term="connotea"/>
  <category term="rss"/>
  <summary type="html">

    &amp;lt;p&amp;gt; While I&amp;amp;#39;m doing my &amp;lt;a href=&amp;quot;http://www.benlund.co.uk/&amp;quot;&amp;gt;freelance and hobby work&amp;lt;/a&amp;gt;, I need to have certain reference materials close at hand. Of course, I&amp;amp;#39;ve got my various &amp;lt;a href=&amp;quot;http://www.oreilly.com/&amp;quot;&amp;gt;O&amp;amp;#39;Reilly&amp;lt;/a&amp;gt; and &amp;lt;a href=&amp;quot;http://www.pragmaticprogrammer.com/&amp;quot;&amp;gt;Pragmatic Programmers&amp;lt;/a&amp;gt; books on my bookshelf, but what do I do about those indispensable online resources? &amp;lt;/p&amp;gt;

    </summary>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">

      <p> While I&#39;m doing my <a href='http://www.benlund.co.uk/'>freelance and hobby work</a>, I need to have certain reference materials close at hand. Of course, I&#39;ve got my various <a href='http://www.oreilly.com/'>O&#39;Reilly</a> and <a href='http://www.pragmaticprogrammer.com/'>Pragmatic Programmers</a> books on my bookshelf, but what do I do about those indispensable online resources? </p>
<p> Browser bookmarks, of course, are the answer. But I keep my <a href='http://del.icio.us/benlund'>bookmarks</a> <a href='http://www.connotea.org/user/ben'>online</a>, and it&#39;s a hassle, not to mention at least three clicks and page-loads, to get to the source via the online bookmarking service. </p>
<p> Happily, an answer is at hand using a combination of Del.icio.us tags, RSS, and Firefox Live Bookmarks. Here&#39;s what I do: </p>
<ul><li>Any web page that I want to appear in my online reference shelf, I tag with <a href='http://del.icio.us/benlund/refshelf'>refshelf</a>.</li><li>I subscribe to the <a href='http://del.icio.us/rss/benlund/refshelf'>RSS feed for this tag</a> using Firefox. <ul><li>To do this, you start on your refshelf tag page</li><li>click on the orange RSS icon in the browser&#39;s address bar</li><li>select &#34;Subscribe to <em>your user name&#39;s</em> bookmarks tagged &#39;refshelf&#39;&#34;</li><li>select &#34;Live Bookmarks&#34; from the drop-down list</li><li>and click subscribe.</li></ul></li></ul>
<p>I chose to put the subscription in my Bookmarks Toolbar Folder, which gives me access to any of the items in two clicks and one page-load:</p>
<img src='http://benlund.info/static/delicious-refshelf.png'/>
<p> Of course, being an RSS feed, this list is automatically updated to contain anything I tag with &#34;refshelf&#34; on Del.icio.us. </p>
<p> I originally tried this experiment using Connotea. However, the <a href='http://www.connotea.org/rss/user/ben/tag/refshelf'>Connotea RSS feeds</a> don&#39;t link directly to the source, but rather to a page on Connotea about your bookmark, which itself links to the source. So I <a href='http://benlund.info/2007/01/30/contodel'>copied my bookmarks across to Del.icio.us</a> for this experiment. I have no-one but myself to blame for this, since it was me who made that particularly stupid design decision, back in a <a href='http://www.connotea.org/wiki/User:ben'>former life</a>... </p>
<p> There is one advantage to using Connotea instead, which is that you can easily get past the restriction on the number of items that are given in an RSS feed by adding a ?num=50 (or whatever) to the RSS feed URL. However, I like to keep my refshelf focused on just the essentials, so I haven&#39;t hit the limit yet on Del.icio.us. </p>
        </div>
  </content>
</entry>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="html">The Breakfast Menu of Programming Languages</title>
  <link href="http://benlund.info/2007/03/11/breakfast-menu-of-programming-languages" rel="alternate"/>
  <link href="http://benlund.info/2007/03/11/breakfast-menu-of-programming-languages/atom" rel="edit"/>
  <id>http://benlund.info/2007/03/11/breakfast-menu-of-programming-languages</id>
  <updated>2007-03-11T15:59:33Z</updated>
  <published>2007-03-11T15:59:33Z</published>
  <author>
    <name>Ben Lund</name>
  </author>
  <category term="main" label="Front Page"/>
  <category term="web_development" label="Web Development"/>
  <category term="programming_languages" label="Programming Languages"/>
  <summary type="html">

    &amp;lt;p&amp;gt; You wake up in the morning and you decide to build a Web Application. But that is just the beginning of a difficult decision -- what language are you going to use? &amp;lt;/p&amp;gt;

    </summary>
  <content type="xhtml">
    <div xmlns="http://www.w3.org/1999/xhtml">

      <p> You wake up in the morning and you decide to build a Web Application. But that is just the beginning of a difficult decision -- what language are you going to use? </p>
<p> You wake up in the morning and decide to have toast for breakfast. But that&#39;s not all you have to decide, it&#39;s even more important to decide what you should spread on your toast. </p>
<ul><li><strong>Chocolate Spread / PHP</strong> : It&#39;s nice and easy, but it&#39;s not really proper food, is it?</li><li><strong>Strawberry Jam / Java</strong> : It all fruit! That&#39;s got to be good for you, right? But the seeds are gonna get in your teeth, and the sugar is going to rot them...</li><li><strong>Chunky Peanut Butter / Perl</strong> : It looks like you&#39;ve spread vomit over your toast, but, mmm-mmm, it tastes nice.</li><li><strong>Marmite / Lisp</strong> : You either love it or you hate it.</li><li><strong>Vegemite / Scheme</strong> : A slightly more palatable version of Marmite, but it&#39;s really hard to find in stores.</li><li><strong>Peanut Butter with Jam / Ruby</strong> : Sounds crazy. That&#39;s for kids, right? And talk about taking ages to spread. But argue all you like -- once you&#39;ve tasted it, you&#39;ll believe in it...</li></ul>
        </div>
  </content>
</entry>
</feed>
