Del.icio.us AutoTag

By Theron Parlin Last update Apr 6, 2007 — Installed 1,020 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 2, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0
// ==UserScript==
// @name           Del.icio.us AutoTag
// @namespace      http://e5media.com
// @description    Inserts popular tags automatically into the tag field, if there are no popular tags, it inserts recommended tags.
// @include        http://del.icio.us/*
// ==/UserScript==

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();
  }

  var myarray = finaltags.split(",");
  for (var tag in myarray) {
    if (document.getElementById('tags').value.search(/myarray[tag]/) == -1) {
	    document.getElementById('tags').value += myarray[tag] + " ";
	  }
  }
}