-
-
Save hwrdprkns/1363467 to your computer and use it in GitHub Desktop.
dick move
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
USAGE: | |
copy and paste all of this into the javascript console. you can then call falseVote(ians_comment_id, times) to upvote | |
ian as partygoer times times. you can also provide your own comment_id by doing an inspect element on the voting div | |
on anyone's profile. | |
the ajax requests are synchronous to allow for the coockie bs. this makes the execution seem slow for large times. | |
i wonder how long it takes to run it for thousands of iterations... | |
*/ | |
//for voting up ian as partygoer | |
ians_comment_id = 229844; | |
//from StackOverflow somewhere... of course... | |
function deleteAllCookies() { | |
var cookies = document.cookie.split(";"); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = cookies[i]; | |
var eqPos = cookie.indexOf("="); | |
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; | |
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; | |
} | |
} | |
function falseVote(comment_id, times) | |
{ | |
vote_type = 'maybe'; | |
url = 'vote.php'; | |
direction = 'upVote'; | |
var start = new Date().getTime(); | |
for(i=0; i<times; i++) | |
{ | |
$.ajax({ | |
type: "GET", | |
async: false, | |
url: "about.php", | |
}); | |
$.ajax({ | |
type: "POST", | |
async: false, | |
data: "action="+direction+"&comment_id="+comment_id+"&vote_type="+vote_type, | |
url: "./methods/"+url, | |
}); | |
deleteAllCookies(); | |
} | |
var end = new Date().getTime(); | |
var time = (end - start) / (1000 * 60 * 60); //hours | |
alert('You are sage: ' + time); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment