del.icio.us isn’t it?

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’ve run across it? This time I signed up and converted.

The idea of moving my bookmarks online has been nagging at me for almost a year so it’s good that I had an excuse. :)

### Bad News

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.

[Bad Bookmarklet v3](https://secure.del.icio.us/register?step2):

javascript:location.href=’http://del.icio.us/post?v=3&url=’+
encodeURIComponent(location.href)+
‘&title=’+encodeURIComponent(document.title.replace(/^\s*|i\s*g,”))

See the problem? The regular expression in the title.replace bit is missing the closing “/” 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.

[Bad Bookmarklet v4](http://del.icio.us/help/buttons):

javascript:location.href=’http://del.icio.us/post?v=4;url=’+
encodeURIComponent(location.href)+’;title=’+
encodeURIComponent(document.title.replace(/^\s*|\s*g,”))

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.

Corrected Code (Just for fun, I’ll call it v5):

javascript:location.href=’http://del.icio.us/post?v=5;url=’+
encodeURIComponent(location.href)+’;title=’+
encodeURIComponent(document.title.replace(/^\s*|\s*$/g,”))

Here we go! We’ve added our closing “/” and dropped in the dollar sign into the second condition to mean “only remove extra spaces from the end of the title.”

### Oh right, the link

[Gregg’s Bookmarks](http://del.icio.us/whoisgregg)

2 Comments

  1. Thanks for linking me. So the markup didn’t work on Safari, huh? Try using the RSS plugins for wordpress. They are excellent.

  2. Hi April,

    The markup worked fine actually. The only reason I didn’t stick with your template is because I had trouble grokking how the CSS was organized. There was some hacking I wanted to do with the design and I ran into trouble accomplishing the changes. So, I decided to start with the default template and work towards my design goal. The result looks rather familiar I bet. :)

    Which RSS plugins would you recommend?

Comments are closed.