Skip to content

Instantly share code, notes, and snippets.

@miou-gh
Last active August 14, 2016 19:04
Show Gist options
  • Save miou-gh/6ecc1b0a99f2aa2f6dd3cef5e6866d79 to your computer and use it in GitHub Desktop.
Save miou-gh/6ecc1b0a99f2aa2f6dd3cef5e6866d79 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name AutoRep
// @namespace arf
// @description arf
// @include /^https?://forums.everybodyedits\.com/.*$/
// @version 1
// @grant GM_xmlhttpRequest
// @author atillabyte
// ==/UserScript==
var users = [];
// examples
// negative reputation
// users.push({ pid: '601369', uid: '1381', poster: 'AnatolyEE', method: '2', message: 'homophobia' });
// positive reputation
// users.push({ pid: '601369', uid: '1381', poster: 'AnatolyEE', method: '1', message: 'an ok person' });
function autorep() {
for (var i = 0; i < users.length; i++) {
var user = users[i];
var urlparam = 'http://forums.everybodyedits.com/reputation.php?&pid=' + user.pid + '&uid=' + user.uid + '&method=' + user.method;
GM_xmlhttpRequest({
method: 'POST',
url: urlparam,
data: 'form_sent=1&pid=' + user.pid + '&poster=' + user.poster + '&method=' + user.method + '&req_message=' + encodeURIComponent(user.message) + '&submit=Submit',
headers: {
'Host': 'forums.everybodyedits.com',
'User-agent': 'Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Waterfox/47.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Referer': urlparam,
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Cookie': document.cookie
},
onload: function (responseDetails) {
if (responseDetails.responseText.contains('You must wait 300 minutes before you can give new voice.')) {
console.log('Need to wait longer.');
} else {
console.log('Status ' + responseDetails.status +
'Response:\n' + responseDetails.responseText);
}
}
});
}
}
window.addEventListener('load', function () {
autorep();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment