{"id":650,"date":"2008-04-07T11:09:42","date_gmt":"2008-04-07T16:09:42","guid":{"rendered":"http:\/\/blogs.law.harvard.edu\/hoanga\/2008\/04\/07\/a-quick-survey-of-delicious-apis-for-r"},"modified":"2008-04-07T11:09:44","modified_gmt":"2008-04-07T16:09:44","slug":"a-quick-survey-of-delicious-apis-for-ruby","status":"publish","type":"post","link":"https:\/\/archive.blogs.harvard.edu\/hoanga\/2008\/04\/07\/a-quick-survey-of-delicious-apis-for-ruby\/","title":{"rendered":"A quick survey of del.icio.us APIs for Ruby"},"content":{"rendered":"<p>I had this task where I wanted to pull information from <a href=\"http:\/\/del.icio.us\">del.icio.us<\/a> for some data processing so I decided to take a look at what was available for Ruby.  Before, I say what path I took let&#8217;s go over the choices I dug up.<\/p>\n<h3>Ridiculous<\/h3>\n<p>First up was <a href=\"http:\/\/ridiculous.rubyforge.org\/\">Ridiculous<\/a> which labels it as a <em>simple wrapper for the del.icio.us API<\/em>.  After looking at the <a href=\"http:\/\/ridiculous.rubyforge.org\/doc\">API<\/a> I definitely agree it is quite simple to use.  So here are the highlights.<\/p>\n<h4>The good<\/h4>\n<ul>\n<li>BSD Licensed<\/li>\n<li>API really is simple<\/li>\n<li>Has a rubygem (Any serious ruby tool should be available via rubygems)<\/li>\n<\/ul>\n<h4>The bad<\/h4>\n<ul>\n<li>Seems to require logging into delicious<\/li>\n<li>Only seems to manage a delicious user&#8217;s bookmarks<\/li>\n<\/ul>\n<h3>Mirrored<\/h3>\n<p>Next was <a href=\"http:\/\/mirrored.rubyforge.org\/rdoc\/\">mirrored<\/a> which looks like it is modeled on Active Record.<\/p>\n<h4>The Good<\/h4>\n<ul>\n<li>Acts like an Active Record Model (nice for Rails guys)<\/li>\n<li>Supports both del.icio.us and ma.gnolia.com<\/li>\n<li>Has a rubygem<\/li>\n<li>MIT-ish licensed<\/li>\n<\/ul>\n<h4>The Bad<\/h4>\n<ul>\n<li>A little more complex than ridiculous (counting # of classes)<\/li>\n<li>Only handles a logged in user scenario<\/li>\n<li>Requires logging in<\/li>\n<\/ul>\n<h3>ruby-Delicious<\/h3>\n<p>Next up was <a href=\"http:\/\/blog.apokalyptik.com\/2007\/02\/10\/ruby-delicious\/\">this blog post<\/a> that pointed to ruby-Delicious.   However, when I clicked on <a href=\"http:\/\/blog.apokalyptik.com\/2007\/02\/10\/ruby-delicious\/\">the link<\/a> I got a Forbidden.  I love abandon-ware.  I decided not to look much farther since the author obviously wanted to talk about something he didn&#8217;t think about maintaining.<\/p>\n<h3>What I wanted<\/h3>\n<p>What I wanted was something a little more full-featured like Python&#8217;s <a href=\"http:\/\/code.google.com\/p\/pydelicious\/source\/browse\/trunk\/pydelicious.py\">pydelicious<\/a> library.   It handled both cases of being logged in and wanting to update bookmarks AND just the lazy joe who wanted to yank data from delicious without having to stuff it into a data structure by hand.<\/p>\n<p>In the end I ended up using none of the above since none of them did what I really wanted and after a little of Googling saw many snippets <a href=\"http:\/\/snippets.dzone.com\/posts\/show\/2431\">[1]<\/a>, <a href=\"http:\/\/snipplr.com\/view\/2477\/ruby-delicious\/\">[2]<\/a>, <a href=\"http:\/\/semantichumanities.wordpress.com\/2006\/09\/04\/tutorial-networks-of-folksonomy-with-ruby-delicious-and-graphiz\/\">[3]<\/a> that showed how one could do it with just open-uri.  In the end I decided to just use open-uri since it ended up being a big fat <b>3<\/b> lines of code to implement the base case of what I wanted with open-uri.   With a few more lines I had exception handling and retrying on failure.<\/p>\n<p>However, hopefully someone else will be able to make use of the above libraries since they do like quite useful for programatically accessing delicious.<\/p>\n<p>[1] <a href=\"http:\/\/snippets.dzone.com\/posts\/show\/2431\">Use delicious API via HTTPS from Ruby<\/a><br \/>\n[2] <a href=\"http:\/\/snipplr.com\/view\/2477\/ruby-delicious\/\">Ruby delicious snippet<\/a><br \/>\n[3] <a href=\"http:\/\/semantichumanities.wordpress.com\/2006\/09\/04\/tutorial-networks-of-folksonomy-with-ruby-delicious-and-graphiz\/\">Ruby, delicious and graphviz<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had this task where I wanted to pull information from del.icio.us for some data processing so I decided to take a look at what was available for Ruby. Before, I say what path I took let&#8217;s go over the choices I dug up. Ridiculous First up was Ridiculous which labels it as a simple [&hellip;]<\/p>\n","protected":false},"author":703,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[972,615],"tags":[],"class_list":["post-650","post","type-post","status-publish","format-standard","hentry","category-programming","category-ruby"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts\/650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/users\/703"}],"replies":[{"embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":0,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"wp:attachment":[{"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archive.blogs.harvard.edu\/hoanga\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}