阅读:3734回复:8
greasemonkey编写高手来帮帮忙.google网页快照
这是一个访问google cache的脚本。
怎么才能让66.249.81.99 , 66.102.7.104 , 64.233.161.104 , 64.233.161.104 去随机替代64.233.167.104 ? (function() { var allLinks = document.links; if (allLinks != null) { for (i = 0; i <allLinks.length; ++i) { if (allLinks .href.indexOf ("/search?q=cache:") > 0) { allLinks .href = allLinks .href.replace ("/search?q=cache:", "/search?&q=cache:"); allLinks .href = allLinks .href.replace ("72.14.235.104", "64.233.167.104"); } } } } )(); |
|
1楼#
发布于:2006-12-12 22:58
好东东
|
|
2楼#
发布于:2006-12-12 22:58
javascript,一种脚本语言。网上的教程到处都是,配合论坛的wiki翻译 《Dive to GreaseMonkey》,写这样的小脚本挺简单的。
|
|
|
3楼#
发布于:2006-12-12 22:58
JS
|
|
4楼#
发布于:2006-12-12 22:58
|
|
5楼#
发布于:2006-12-12 22:58
你问的是什么?这段js代码我是写在一个html文件里,Dreamweaver 编写,firefox的javascript console调试的.
|
|
|
6楼#
发布于:2006-12-12 22:58
Jacky-Q:this should work....var allLinks = document.links; var ra=Math.round(Math.random()*1000); var _raplaceIPAddress=""; switch(ra%4){ case 0:_raplaceIPAddress="66.249.81.99"; break; case 1:_raplaceIPAddress="66.102.7.104";break; case 2:_raplaceIPAddress="64.233.161.104";break; case 3:_raplaceIPAddress="64.233.161.104";break; } if (allLinks != null){ for (i = 0; i <allLinks.length; ++i){ if (allLinks [i].href.indexOf ("/search?q=cache:") > 0){ allLinks [i].href = allLinks [i].href.replace ("/search?q=cache:", "/search?&q=cache:"); allLinks [i].href = allLinks [i].href.replace ("72.14.235.104", _raplaceIPAddress); } } }回到原帖 (function() { var allLinks = document.links; var ra=Math.round(Math.random()*1000); var _raplaceIPAddress=""; switch(ra%9){ case 0:_raplaceIPAddress="64.233.167.104"; break; case 1:_raplaceIPAddress="66.102.7.104";break; case 2:_raplaceIPAddress="66.102.9.104";break; case 3:_raplaceIPAddress="66.102.11.104";break; case 4:_raplaceIPAddress="72.14.207.104";break; case 5:_raplaceIPAddress="216.239.53.104";break; case 6:_raplaceIPAddress="216.239.59.104";break; case 7:_raplaceIPAddress="216.239.63.104";break; case 8:_raplaceIPAddress="64.233.179.104";break; } if (allLinks != null) { for (i = 0; i <allLinks.length; ++i) { if (allLinks [i].href.indexOf ("/search?q=cache:") > 0) { allLinks [i].href = allLinks [i].href.replace ("/search?q=cache:", "/search?&q=cache:"); allLinks [i].href = allLinks [i].href.replace ("72.14.235.104", _raplaceIPAddress); } } } } )(); 谢谢...起效了...万分感谢.. 顺便想请问一下这个是用什么软件编的? |
|
7楼#
发布于:2006-12-12 22:58
this should work....
var allLinks = document.links; var ra=Math.round(Math.random()*1000); var _raplaceIPAddress=""; switch(ra%4){ case 0:_raplaceIPAddress="66.249.81.99"; break; case 1:_raplaceIPAddress="66.102.7.104";break; case 2:_raplaceIPAddress="64.233.161.104";break; case 3:_raplaceIPAddress="64.233.161.104";break; } if (allLinks != null){ for (i = 0; i <allLinks.length; ++i){ if (allLinks [i].href.indexOf ("/search?q=cache:") > 0){ allLinks [i].href = allLinks [i].href.replace ("/search?q=cache:", "/search?&q=cache:"); allLinks [i].href = allLinks [i].href.replace ("72.14.235.104", _raplaceIPAddress); } } } |
|
|
8楼#
发布于:2006-12-12 22:58
不要一帖多发啊
|
|