oAutoPagerizeのGoogleイメージ検索対応 oAutoPagerize ver 0.4.1

風柳亭: AutoPagerize/AutoPagerlike:Google イメージ検索への対応を試みるを見たところに、コメントでGoogle画像検索対応をお願いされたので、対応してみました。
更新はoAutoPagerize - 0xFFからどうぞ。

SITEINFOを工夫して、本体にはほとんど手を入れずに動くようにしてみました。

,{
url:           'http://images\\.google\\..+/images\\?.+'
,nextLink:     'id("nn")/parent::a'
,pageElement:  '//table[tbody/tr/td/a[starts-with(@href,"/imgres")]]'
,exampleUrl:   'http://images.google.com/images?gbv=2&hl=ja&safe=off&q=%E3%83%9A%E3%83%BC%E3%82%B8'
}

nextLinkの書き換え部分については風柳亭さんのコードを参考にさせていただきました。

if (/^http:\/\/images\.google\..+\/images\?.+/.test(location.href)) (function(){
	//via http://furyu.tea-nifty.com/annex/2008/04/autopagerizeaut_c163.html
	var nn = document.getElementById('nn');
	var n = nn.parentNode;
	if (n) n.href = n.href.replace(/[\?&]gbv=2/,'') + '&gbv=1';
})();

ついでに、AutoPagerizeにインクリメントモードとURLフィルターを追加するプラグインを書いてみた - 0xFFにもこの改造を導入してみました。