Skip to content

Instantly share code, notes, and snippets.

@hwrdprkns
Forked from erikformella/dabbutHax.js
Created November 14, 2011 07:44
Show Gist options
  • Save hwrdprkns/1363467 to your computer and use it in GitHub Desktop.
Save hwrdprkns/1363467 to your computer and use it in GitHub Desktop.
dick move
/*
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