Skip to content

Instantly share code, notes, and snippets.

@rhaps0dy
Last active December 11, 2016 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhaps0dy/dedea3ac689e11bbce76fad74c854c30 to your computer and use it in GitHub Desktop.
Save rhaps0dy/dedea3ac689e11bbce76fad74c854c30 to your computer and use it in GitHub Desktop.
Vote for a charity in Project Awesome

#How to use this?

  1. Go to a charity's page, such as the AMF or the GFI.

  2. Click. one of the videos and vote, normally. This is so you complete the captcha thing.

  3. Go back to the charity page.

  4. Open the browser console. * OS X: Cmd + alt + i, for Chrome and Firefox. * Linux/Windows: Ctrl + Shift + i, for Chrome and Firefox.

  5. Copy the text in the file vote.js, and paste it in the console's text field. Press Enter and wait.

(function() {
'use strict';
var videos = $(".video-link");
function do_one_video(i) {
console.log("Loading page of video " + (i+1) + " of " + videos.length + "...");
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", videos[i].href);
ifrm.style.width = "640px";
ifrm.style.height = "480px";
document.body.insertBefore(ifrm, document.body.firstChild);
var jq_ifrm = $(ifrm);
jq_ifrm.load(function() {
console.log("Page loaded.");
var form = jq_ifrm.contents().find(".form-horizontal");
if(form.length === 0) {
console.log("Already voted, skipping.");
} else {
form.submit();
console.log("Voted!");
}
jq_ifrm.remove();
if(i+1 < videos.size())
do_one_video(i+1);
else
console.log("Finished!");
});
}
if(document.URL.search("charity") < 0) {
console.log("You're not in a charity page! Please go to one.");
} else {
do_one_video(0);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment