Forum Moderators: coopster
Thank you.
NOTE: Due to the escaping on this site, you need to replace the ¦ with a regular pipe symbol in order to make Hanu's code work. There are three occurrences of it.
<html><head><script>
var GPR_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
function GPR_awesomeHash(value) {
var kindOfThingAnIdiotWouldHaveOnHisLuggage = 16909125;
for(var i = 0;i < value.length;i ++ ) {
kindOfThingAnIdiotWouldHaveOnHisLuggage ^= GPR_HASH_SEED.charCodeAt(i % GPR_HASH_SEED.length) ^ value.charCodeAt(i);
kindOfThingAnIdiotWouldHaveOnHisLuggage = kindOfThingAnIdiotWouldHaveOnHisLuggage >>> 23 ¦ kindOfThingAnIdiotWouldHaveOnHisLuggage << 9}
return "8" + GPR_hexEncodeU32(kindOfThingAnIdiotWouldHaveOnHisLuggage)
}
function GPR_hexEncodeU32(num) {
var result = GPR_toHex8(num >>> 24);
result += GPR_toHex8(num >>> 16 & 255);
result += GPR_toHex8(num >>> 8 & 255);
return result + GPR_toHex8(num & 255)
}
function GPR_toHex8 (num) {
return(num < 16? "0" : "") + num.toString(16)
}
function $(id) {
return document.getElementById(id)
}
function generate(f) {
$('r').innerHTML = GPR_awesomeHash( f.q.value )
}
function query(f) {
var x = f.fe.selectedIndex
var u =
'http://' + f.h.value
+ '/search?client=navclient-auto'
+ ( x == 0? '' : '&features=' + f.fe.options[x].value )
+ '&start=' + f.s.value
+ '&num=' + f.n.value
+ '&ch=' + GPR_awesomeHash( f.q.value )
+ '&q=' + ( f.i.checked ¦¦ x > 0? 'info:' : '' ) + encodeURIComponent( f.q.value )
$('r').innerHTML = '<a target="blank" href="' + u +'">' + u + '</a>'
return u;
}
</script><style>
label { display:block; margin-bottom:1ex; margin-top:1ex; }
.t { width:100%; }
#rp { width:100%; background-color:#CCC; }
</style></head><body>
<form><fieldset><legend>Ugly, Bad-Ass Scammers' Ajaxed Query Generator</legend>
<label>Query: <input type="text" name="q" class="t"></label>
<input type="button" value="Generate Checksum" onclick="generate( this.form )" >
<label>"info:" <input type="checkbox" name="i" value="1">
<label>Start: <input type="text" maxlength="3" size="1" name="s" value="0"></label>
<label>Num: <input maxlength="3" size="1" type="text" name="n" value="10"></label>
<label>Features: <select name="fe">
<option value="All" selected="selected"></option>
<option value="Rank">Rank</option>
<option value="Level">Level</option>
<option value="Filter">Filter</option>
<option value="Hostname">Hostname</option>
<option value="URL">URL</option>
<option value="Results">Results</option>
<option value="Summary">Summary</option>
<option value="Title">Title</option>
<option value="CacheSize">CacheSize</option>
<option value="Link">Link</option>
</select></label>
<label>Host: <input type="text" name="h" class="t" value="toolbarqueries.google.com"></label>
<input type="button" value="Generate Query URL" onclick="query( this.form )" >
<input type="button" value="Show Query Result" onclick="$('rp').src=query( this.form )" >
</fieldset></form>
<p id="r"></p>
<iframe frameborder="0" height="60%" id="rp"></iframe>
</body></html>
[edited by: Komodo_Tale at 7:16 pm (utc) on July 10, 2006]