{"id":5,"date":"2006-10-14T15:46:48","date_gmt":"2006-10-14T19:46:48","guid":{"rendered":"http:\/\/whoisgregg.com\/blog\/2006\/10\/delicious-isnt-it.html"},"modified":"2006-10-14T18:25:17","modified_gmt":"2006-10-14T22:25:17","slug":"delicious-isnt-it","status":"publish","type":"post","link":"http:\/\/www.whoisgregg.com\/blog\/2006\/10\/delicious-isnt-it\/","title":{"rendered":"del.icio.us isn&#8217;t it?"},"content":{"rendered":"<p>Because I <del>chose<\/del> _toyed with the idea of using_ the very chic [Japanese Cherry Blossom](http:\/\/krisandapril.us\/2006\/06\/11\/japanese-cherry-blossom\/) template, I was introduced to the [del.icio.us bookmarking site](http:\/\/del.icio.us\/) yet again. The difference between this time and the last dozen or so times I&#8217;ve run across it? This time I signed up and converted.<\/p>\n<p>The idea of moving my bookmarks online has been nagging at me for almost a year so it&#8217;s good that I had an excuse. :)<\/p>\n<p>### Bad News<\/p>\n<p>The bookmarklet provided during the sign up process (v3) and the one I downloaded from the help section (v4) both failed to work in Safari. Each threw a syntax error.<\/p>\n<p>[Bad Bookmarklet v3](https:\/\/secure.del.icio.us\/register?step2):<\/p>\n<blockquote class=\"code javascript\"><p>javascript:location.href=&#8217;http:\/\/del.icio.us\/post?v=3&#038;url=&#8217;+<br \/>\nencodeURIComponent(location.href)+<br \/>\n&#8216;&#038;title=&#8217;+encodeURIComponent(document.title.replace(\/^\\s*|i\\s*g,&#8221;))<\/p><\/blockquote>\n<p>See the problem? The regular expression in the title.replace bit is missing the closing &#8220;\/&#8221; plus it has the critical flaw that it removes all the spaces from the entire title, Not just the ones at the beginning and the end.<\/p>\n<p>[Bad Bookmarklet v4](http:\/\/del.icio.us\/help\/buttons):<\/p>\n<blockquote class=\"code javascript\"><p>javascript:location.href=&#8217;http:\/\/del.icio.us\/post?v=4;url=&#8217;+<br \/>\nencodeURIComponent(location.href)+&#8217;;title=&#8217;+<br \/>\nencodeURIComponent(document.title.replace(\/^\\s*|\\s*g,&#8221;))<\/p><\/blockquote>\n<p>Same problem here, the only difference between versions is that this passes the variables via javascript instead of in the URL. Probably to deal with extraordinarily long URLs and titles breaking the maximum character length of the URI field.<\/p>\n<p>Corrected Code (Just for fun, I&#8217;ll call it v5): <\/p>\n<blockquote class=\"code javascript\"><p>javascript:location.href=&#8217;http:\/\/del.icio.us\/post?v=5;url=&#8217;+<br \/>\nencodeURIComponent(location.href)+&#8217;;title=&#8217;+<br \/>\nencodeURIComponent(document.title.replace(\/^\\s*|\\s*$\/g,&#8221;))<\/p><\/blockquote>\n<p>Here we go! We&#8217;ve added our closing &#8220;\/&#8221; and dropped in the dollar sign into the second condition to mean &#8220;only remove extra spaces from the end of the title.&#8221;<\/p>\n<p>### Oh right, the link<\/p>\n<p>[Gregg&#8217;s Bookmarks](http:\/\/del.icio.us\/whoisgregg)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because I chose _toyed with the idea of using_ the very chic [Japanese Cherry Blossom](http:\/\/krisandapril.us\/2006\/06\/11\/japanese-cherry-blossom\/) template, I was introduced to the [del.icio.us bookmarking site](http:\/\/del.icio.us\/) yet again. The difference between this time and the last dozen or so times I&#8217;ve run across it? This time I signed up and converted. The idea of moving my bookmarks&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts\/5"}],"collection":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/comments?post=5"}],"version-history":[{"count":0,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/posts\/5\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/media?parent=5"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/categories?post=5"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.whoisgregg.com\/blog\/wp-json\/wp\/v2\/tags?post=5"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}