Hatena::Groupmoz-addon

Ci.nsIZIGOROu

2008-08-07

Googleの検索結果に順位を付けるグリモン

| 19:26 |  Googleの検索結果に順位を付けるグリモン - Ci.nsIZIGOROu を含むブックマーク はてなブックマーク -  Googleの検索結果に順位を付けるグリモン - Ci.nsIZIGOROu

f:id:ZIGOROu:20080814165515p:image

// ==UserScript==
// @name           AddRankingNumberToGoogleSearchResults
// @namespace      http://moz-addon.g.hatena.ne.jp/ZIGOROu/
// @description    Add ranking number to google search results
// @include        http://www.google.co.jp/search?*
// @include        http://www.google.com/search?*
// ==/UserScript==
(function() {
  function parseQuery() {
	var query = {};
	location.search.replace(/^\?/, "").split(/&/).forEach(
	  function(pair) {
		pair = pair.split(/=/);
		if (query[pair[0]] && !(query[pair[0]] instanceof Array)) {
		  query[pair[0]] = [ query[pair[0]], decodeURIComponent(pair[1]) ];
		}
		else {
		  query[pair[0]] = decodeURIComponent(pair[1]);
		}
      }
	);

	return query;
  }

  var q = parseQuery();
  var offset = parseInt(q.start || 0);
  var ss = document.evaluate('//h3[@class="r"]/a', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  for (var i = 0; i < ss.snapshotLength; i++) {
	ss.snapshotItem(i).textContent = (offset + 1 + i).toString() + ". " + ss.snapshotItem(i).textContent;
  }
})();

ShravsShravs2012/04/29 11:54The honesty of your posting shines trhough

sdwpxcfsdwpxcf2012/04/29 18:10DoOfNl <a href="http://hxbadpmnqkzt.com/">hxbadpmnqkzt</a>

paojzywengdpaojzywengd2012/05/02 14:56Q48TeX , [url=http://sfpephmrbwkf.com/]sfpephmrbwkf[/url], [link=http://wlvxjrxvrdhd.com/]wlvxjrxvrdhd[/link], http://ddtxkiakvuwu.com/