Forum Moderators: open
You know, so you have a quick visual as to where your red widget site is ranking when you search for it (rather than counting it manually).
I know I have seen such a thing on other people's screens - but the first and only extension that purports to do such a thing doesn't seem to work for me.
// get the results, identified by a class of 'l'
var searchResults=document.getElementsByClassName('l');// loop through the results and prefix with a span containing the result number
for ( var i in searchResults )
{
var numberSpan = document.createElement("span");
var resultNumber = document.createTextNode(((i-0)+1)+'. ');
numberSpan.appendChild(resultNumber);
searchResults[i].parentNode.insertBefore(numberSpan, searchResults[i]);
}
You could quite easily make this into a bookmarklet, by creating a bookmark within firefox to the below, when you click t he bookmark, numbers will show:
javascript:var searchResults=document.getElementsByClassName('l');for ( var i in searchResults ) {var numberSpan = document.createElement("span"); var resultNumber = document.createTextNode(((i-0)+1)+'. ');numberSpan.appendChild(resultNumber);searchResults[i].parentNode.insertBefore(numberSpan, searchResults[i]);}
I assume there would be ways to integrate something like this without the need for a click.
[edited by: Receptional_Andy at 9:19 pm (utc) on Aug. 13, 2008]
- bookmark this thread (in your bookmarks toolbar folder)
- right click on the created bookmark, and in the location: section past in the code in my second example above (starting with javascript:)
- when you click the link on a Google result page, you'll see numbers in the serps
Unfortunately I can't link to javascript based links here, which makes it slightly harder to explain.
I believe the script above works for both templates since Google retain a class of 'l' for the organic serps in each. Of course, if Google changes class names, the script would need an update.