I like Alan Marklet's Maker, the tool that let you create bookmarklets to add links to del.icio.us. But I wanted something that let me either use some text I highlighted in the page, or else the description meta-tag. So I hacked the original bookmarklet and made it my own. Shame that WordPress won't let me publish in a useful format.
To Use:
Copy the code below, paste it in a text editor, and change fritzthecat to your del.icio.us user name. Drag this link: +del.icio.us to your toolbar. Right-click on it, and change its address to the code you just edited. Now when you are on a page you want to bookmark, you can select a sentence you want to use as description, or, the bookmarklets will choose the page's description, if it's got one.
javascript:{var d=document; var te=''; if(window.getSelection)te=window.getSelection(); else if(document.getSelection)te=document.getSelection(); else if(document.selection)te=document.selection.createRange().text; if(te==''){var m,ml,mt=document.getElementsByTagName('meta'); ml=mt.length; while(--ml >= 0){m=mt[ml]; if(m.name.toLowerCase()=='description')te=m.content; }}; +''; t=encodeURIComponent(te); u=encodeURIComponent(d.location.href); ti=encodeURIComponent(d.title); document.location.href='http://del.icio.us/new/fritzthecat?v=2&url='+u+'&extended='+t+'&title='+ti; void(0)}
2006.05.16, Tue at 05:31
Thanks for the idea– it always did grab the selected text as a feature (if it did not work, you may not have done the appropriate browser selection on the right side).
I’ve rolled the extra attempt to find the META description tag to the main code at:
http://cogdogblog.com/code/marklet_maker.php
2006.05.17, Wed at 11:00
Cool. I wanted a bookmarklet that worked across browsers, as I work on a variety of platforms.