Welcome to WebmasterWorld Guest from 35.175.120.174

Forum Moderators: open

Message Too Old, No Replies

Firefox SERP Enumerator

is there such a thing?

     
1:18 am on Aug 12, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1085
votes: 10


Is there a tool that will show the SERP numbers down the left side of the page ?

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.

9:07 pm on Aug 13, 2008 (gmt 0)

Senior Member

joined:Jan 27, 2003
posts:2534
votes: 0


I don't write much javascript and this may not even be of use to you, but this one intrigued me a bit, so I had a stab at it. it will only work in firefox 3 since previous versions didn't support getElementsByClassName.

// 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]

10:13 pm on Aug 13, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1085
votes: 10


RA,

OK, so I created a serp.js file in c:\ and I call it from Firefox bookmarks.

When I click on the bookmark, it just loads the file, it doesn't execute it.

Same if I have the bookmark on my toolbar as a bookmarklet.

8:14 am on Aug 14, 2008 (gmt 0)

Senior Member

joined:Jan 27, 2003
posts:2534
votes: 0


Creating a bookmarklet works slightly differently. One way of doing would be to:

- 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.

1:04 pm on Aug 14, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Mar 7, 2003
posts: 1085
votes: 10


This works beautifully.

Nice and simple

This should be fun to see if people modify it.

Thanks!

1:09 pm on Aug 14, 2008 (gmt 0)

Senior Member

joined:Jan 27, 2003
posts:2534
votes: 0


Incidentally, there are a few different HTML formats for Google results going around at the moment - some mark-up the results using an ordered list which means a simple CSS change shows the result number.

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.