{"id":649,"date":"2008-05-13T11:04:31","date_gmt":"2008-05-13T10:04:31","guid":{"rendered":"http:\/\/pete.nu\/blog\/?p=649"},"modified":"2008-05-13T11:36:45","modified_gmt":"2008-05-13T10:36:45","slug":"my-delicious-bookmarklets","status":"publish","type":"post","link":"https:\/\/pete.nu\/blog\/2008\/05\/13\/my-delicious-bookmarklets\/","title":{"rendered":"My del.icio.us bookmarklets"},"content":{"rendered":"<p>I used the <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/2354\">del.icio.us Complete<\/a> extension to assist me in posting to del.icio.us. I could right-click a page, choose &#8220;Post this to del.icio.us&#8221; and a handy dialog came up, prepopulated with the URL, title, and description (populated from whatever text was selected on the page at the time). This was perfect for my needs.<\/p>\n<p>Since upgrading to Firefox 3.0, it seems that the only compatible extensions are the ones that &#8220;integrate&#8221; your bookmarks in an intrusive fashion. I don&#8217;t want integration. I want the exact opposite. I want total disintegration. So I&#8217;ve gone back to using bookmarklets.<\/p>\n<p>I basically use del.icio.us for two things. Firstly, I use it as a todo list. I post links with the &#8220;do not share this&#8221; flag set, and tagged &#8220;todo&#8221;, so that I can look at them later. This is the bookmarklet that I now use for this task:<\/p>\n<p><a href=\"javascript:var%20user='username',pw='password',tag='todo',shared='no',replace='yes';with(document){i=body.appendChild(createElement('iframe'));};var%20notes=getSelection().toString().substring(0,253);if(notes)notes='&quot;'+notes+'&quot;';i.style.display='none';i.src='https:\/\/'+user+':'+pw+'@api.del.icio.us\/v1\/posts\/add?&#038;url='+encodeURIComponent(location.href)+'&#038;description='+encodeURIComponent(document.title)+'&#038;extended='+encodeURIComponent(notes)+'&#038;tags='+tag+'&#038;shared='+shared+'&#038;replace='+replace;alert('Done.');i.parentNode.removeChild(i);void(0);\">Bookmarklet #1<\/a><\/p>\n<p><a href=\"http:\/\/henrik.nyh.se\/2007\/04\/bookmarklet-for-delicious-toread\">I got it here<\/a>. It&#8217;s not perfect though. It doesn&#8217;t seem to work the first time you use it in a session. I guess this is related to the fact that it uses https. It also pops up an alert at the end that says &#8220;OK, tagged as todo&#8221; whether it actually succeeded or not. I tried removing this alert, and the bookmarklet stopped working. Can&#8217;t fathom why.<\/p>\n<p>On to the second bookmarklet:<\/p>\n<p><a href=\"javascript:(function(){e=''+(window.getSelection%20?%20window.getSelection()%20:%20document.getSelection%20?%20document.getSelection()%20:%20document.selection.createRange().text);open('http:\/\/del.icio.us\/post?v=4;noui=yes;jump=close;url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title)+';notes='+encodeURIComponent(e),'delicious','toolbar=no,width=700,height=400')})()\">Bookmarklet #2<\/a><\/p>\n<p>This one is much more straightforward. It just opens a window containing a small &#8220;post&#8221; dialog, prepopulated in the same way as the old del.icio.us Complete extension. It doesn&#8217;t use https, so it never asks me for my login details. The window closes when you post it.<\/p>\n<p>I just thought that I&#8217;d post these bookmarklets here, partly for my own reference, and maybe because someone else might find them useful at some point.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used the del.icio.us Complete extension to assist me in posting to del.icio.us. I could right-click a page, choose &#8220;Post this to del.icio.us&#8221; and a handy dialog came up, prepopulated with the URL, title, and description (populated from whatever text was selected on the page at the time). This was perfect for my needs. Since [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,12,27,349],"tags":[364,95],"class_list":["post-649","post","type-post","status-publish","format-standard","hentry","category-blogging","category-computing","category-guidance","category-useful-information","tag-delicious","tag-firefox"],"_links":{"self":[{"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":0,"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"wp:attachment":[{"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pete.nu\/blog\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}