Google Position Tracker

By Barry Hand Last update Jun 13, 2009 — Installed 2,888 times.

Extension for Google Shopping

in
Subscribe to Extension for Google Shopping 1 post, 1 voice

Marco Rasp User
OperaWindows

Hi,
I made some changes, especially for Google Shopping:

// ==UserScript==

// @name Google Position Tracker
// @author Barry Hand <http://www.barryhand.com/>
// @description Adds an easy to see red number beside each search result in google, allowing you to easily see which position a website is at
// @include http://google.*/*
// @include http://www.google.*/*

// ==/UserScript==

(function() {
var ps = document.getElementsByTagName('li');
var spans = document.getElementsByTagName('span');
var page = 0;
var count = -1;
var start = window.location.href.match("start=([0-9]+)");

start = (start == null)? 0 : start[1];

for (var i = 0, p; p = ps[i]; i++)
if (p.className == 'g' || p.className.substr(0, 3) == 'res'){
count++;
var pos = count + 1 + parseInt(start);
p.innerHTML = '' + pos + '. ' + ps[i].innerHTML;
}

})();

It works now for Google Search & Shopping. The following result pages show the correct position too.

Marco

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel