Autor | Zpráva | ||
---|---|---|---|
tomas1 Profil * |
#1 · Zasláno: 18. 1. 2011, 14:36:09
cau, bol som na
https://chrome.google.com/extensions/detail/pneoplpmnpjoioldpodoljacigkahohc a stiahol som si twento extension. Pozrel som, z akych suborov s sklada(chcem zistit, ako zistuje pagerank :) ) na nasiel som jeden subor, ktoreho obsahom je toto http://pastebin.com/Kzvaq6h1 no a tomu vobec nerozumiem. Za prve, preco to je tak packovane? Ved je to potmo obrovsky bordel, nie? za druhe, co by som mal spravit, aby som si to vedel precitat? Diky :) |
||
pcmanik Profil |
#2 · Zasláno: 18. 1. 2011, 16:17:16
Tu mas rozbalenu verziu
function trim(str, chars) { return ltrim(rtrim(str, chars), chars) } function ltrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("^[" + chars + "]+", "g"), "") } function rtrim(str, chars) { chars = chars || "\\s"; return str.replace(new RegExp("[" + chars + "]+$", "g"), "") } function toHex8(b) { return (b < 16 ? "0": "") + b.toString(16) } function hexEncodeU32(b) { var c = toHex8(b >>> 24); c += toHex8(b >>> 16 & 255); c += toHex8(b >>> 8 & 255); return c + toHex8(b & 255) } function awesomeHash(b) { for (var c = 16909125, d = 0; d < b.length; d++) { var HASH_SEED_ = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."; c ^= HASH_SEED_.charCodeAt(d % HASH_SEED_.length) ^ b.charCodeAt(d); c = c >>> 23 | c << 9 } return hexEncodeU32(c) } function getPageRank(url) { var hash = awesomeHash(url.split("#")[0].split("//")[1]); var query = "http://www.google.com/search?client=navclient-auto&ch=8" + hash + "&features=Rank&q=info:" + url.split("//")[1]; var xhr = new XMLHttpRequest(); xhr.open("GET", query, false); xhr.send(); var pageRank = "N/A"; if (xhr.responseText.length < 15) { pageRank = xhr.responseText.split(":")[2].split("\n")[0] } else { pageRank = "0" } return trim(pageRank) } function setBadge(msg, tabId) { chrome.browserAction.setBadgeText({ 'text': msg, 'tabId': tabId }) } function setIcon(path, tabId) { console.log(path); chrome.browserAction.setIcon({ 'path': path, 'tabId': tabId }) } function setTitle(msg, tabId) { chrome.browserAction.setTitle({ 'title': msg, 'tabId': tabId }) } chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) { var pr = getPageRank(tab.url); setBadge(pr, tab.id); setTitle("Page Rank :" + pr, tab.id); setIcon("images/" + pr + ".png", tab.id) }); Inak pouzi nastroj na stranke http://www.strictly-software.com/unpacker |
||
tomas1 Profil * |
#3 · Zasláno: 18. 1. 2011, 16:39:03
diky velmi pekne :)
|
||
Časová prodleva: 14 let
|
0