Automate Adding Bookmarks to del.icio.us

I use del.icio.us to store all of my infrequently used bookmarks, but I’ve found that browsing by tag just isn’t very efficient for me. I always use a full text search through my bookmarks to find what I’m looking for, so what I’m really looking for is a single-click save solution similar to the star button on the Flock browser.

Greasemonkey comes to the rescue with the del.icio.us autotag user script, but the problem is that you can’t edit the bookmarks by clicking on the del.icio.us tag button, because that script always immediately submits the form, and also duplicates the tags.

I’ve created an upgrade to the script that fixes those problems. Just like the first script, it will automatically add the popular and recommended tags:

image

Here’s the details:

  • Automatically enters in popular or recommended tags, submits the form and closes the pop-up window.
  • If the bookmark has already been saved, it will leave the edit window as is.
  • Doesn’t duplicate the tags if you use the tag button more than once.

And here’s the source code, in case you are interested:

var poptags = unsafeWindow[‘tagPop’];
if (poptags) { // test to make sure we’re on the post page
  if (poptags == “”) {
    var rectags = unsafeWindow[‘tagRec’];
    var finaltags = rectags.toString();
  } else {
    var finaltags = poptags.toString();
  }
  if(document.getElementById(‘tags’).value.length > 4){
    editmode = 1;
  }else{
    editmode = 0;
    var myarray = finaltags.split(“,”);
      for (var tag in myarray) {
            if (document.getElementById(‘tags’).value.search(/myarray[tag]/) == -1) {
            document.getElementById(‘tags’).value += myarray[tag] + ” “;
        }
      }
  }
  if(finaltags.length > 4 && editmode == 0){
      document.getElementById(‘delForm’).submit();
  }
}

I simply couldn’t live without this script, but I wouldn’t recommend using it if you like to browse by tag.

Install del.icio.us automater Greasemonkey script

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.