43 Folders

Back to Work

Merlin’s weekly podcast with Dan Benjamin. We talk about creativity, independence, and making things you love.

Join us via RSS, iTunes, or at 5by5.tv.

”What’s 43 Folders?”
43Folders.com is Merlin Mann’s website about finding the time and attention to do your best creative work.

One-click 'silent' del.icio.us boomarking?

Over a year ago, the lovely and talented Danny O'Brien gave me a fantastic chunk of code. It was the basis for creating a del.icio.us bookmarklet that worked like this:

  1. add your username
  2. add a single tag
  3. save it to your Safari browser bar
  4. when you click it, the page you're viewing is added to your del.ici.ous bookmarks without a popup (or any other screen)

I had about 20 of these and they were wonderfully useful for blazing through a set of tabs and capturing a bunch of pages I'd want to return to later on (but didn't want to futz around with at the time of pure capture).

Important: The best thing about these was that they were "silent" ? by which I mean they just did their work without notification, interaction, or the need for any extra input. Very fast.

The code went like this (note variables [="Red"]USERNAME[/] and [="red"]TAG[/]):

javascript:var%20d%20=%20document;u%20='http://del.icio.us/USERNAME?v=2&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(document.title)+'&tags=TAG';var%20r%20=%20d.createElement('img');r.setAttribute('src',u);r.setAttribute('style','display:%20none');void(d.body.insertBefore(r,%20d.body.firstChild));

At some point these bookmarklets died and I was made sad. Indicating: :(

I know next to zero about javascript so I'm not sure what happened -- guessing that at some point the del.icio.us API (or whatever) changed and these little hacks broke.

Any helpful developers with del.icio.us able to check out this code and suggest a fix that would work today?

Many thanks in advance from the Captain's Table.

31d1's picture

The one i've been using...

The one i've been using is:
javascript:u=%22USERNAME%22;q=location.href;e = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);p=document.title;window.location.href=%22http://del.icio.us/%22+u+%22?tags=%22+escape(%22%s%22)+%22&url=%22+escape(q)+%22&description=%22+escape(p)+ %22&extended=%22 + escape(e).replace(/ /g, %22+%22);

which is a modified version of the one John Ressig came up with.

I'm not sure how yours worked, but this one i'snt even a bookmarklet. You save it as a bookmark with a keyword of for example 'dp' (or whatever the equivalent is in safari), and then when you type "dp tag1 tag2 tag3' in the url bar it'll post the current page with those tags. Also any text you have selected on the page will be the notes. It has USERNAME and the %s is what gets replaced by tags.

It stopped working silently when they changed the api, because it doesn't submit a 'required security token' which is i guess some hidden field in the form. But it still works enough to leave you at the post page, with everything filled in, and ready to click post, albeit with an error message.

They said on the mailing list that 'sorry, yeah we broke that kind of thing, and you can use one of the other ways to do stuff'. I don't know javascript enough to have any ideas about improving it, but even severely hobbled it's still the best UI I've found to add a bookmark.

It would be really nice if this sort of thing could get working again or there was an official way to do it.

 
EXPLORE 43Folders THE GOOD STUFF

Popular
Today

Popular
Classics

An Oblique Strategy:
Honor thy error as a hidden intention


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Cranking

Merlin used to crank. He’s not cranking any more.

This is an essay about family, priorities, and Shakey’s Pizza, and it’s probably the best thing he’s written. »

Scared Shitless

Merlin’s scared. You’re scared. Everybody is scared.

This is the video of Merlin’s keynote at Webstock 2011. The one where he cried. You should watch it. »