Trackback Validator Details

By Jordon Kalilich Last update Jul 18, 2006 — Installed 458 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
// Version 0.2 - July 18, 2006
// By Jordon Kalilich - www.theworldofstuff.com
//
// ==UserScript==
// @name          Trackback Validator Details
// @namespace     http://www.theworldofstuff.com/greasemonkey/
// @description   Lists details of the last 100 trackbacks on the page of the Trackback Validator plugin for WordPress.
// @include       http://*/trackback_validator.php
// ==/UserScript==

var oldFieldset, newFieldset, allImages, theList, color;

oldFieldset = document.getElementsByTagName('fieldset')[0];
if (oldFieldset) {
   allImages = document.getElementsByTagName('img');

   theList = '<ol>';   
   for (var p = (allImages.length - 1); p >= 0; p--) {
      if (allImages[p].title.indexOf('spam') > -1) {
         if (allImages[p].title.indexOf('not') > -1) {
            color = "blue";
         }
         else {
            color = "red";
         }
         theList = theList + '<li><span style="color:' + color + '">' + allImages[p].title + '</span></li>';
      }
   }
   theList = theList + '</ol>';

   newFieldset = document.createElement('fieldset');
   oldFieldset.parentNode.insertBefore(newFieldset, oldFieldset.nextSibling);
   newFieldset.name = 'details';
   newFieldset.innerHTML = '<legend>Details</legend>' + theList;
}