Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Google Form Auto-Completer to destroy Frenchy
// REK FRENHCY'S FORM SCRIPT
// BIGGAGE 2K16
// Edit the variables between the NO TOUCHY SECTIONS
// Function to select form components via Xpath
function getElementByXpath(path) {
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
// ----- NO TOUCHY ABOVE ----- //
// Chess Club Rating (From 1 - 5);
chessClubRating = '1';
// Did you attend weekly and if so why not
weeklyAttendace = false;
reasonForNoWeeklyAttendance = "Dank Memes";
// Would you like to play other games (From 1 - 3);
otherGamesRating = '1';
// Will you join chess club next year?
chess2k17 = false;
// General Feedback on UQ Chess Club
generalFeedback = "It's bad yo"
suggestionsFor2K17 = "Mega Chess Ultimate 4001 GotY, 2014 Pre-Order now!"
// ----- NO TOUCHY BELOW ----- //
// rate chess club / 5
for (i = 1; i < 5; i++){
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[' + i + ']/div[2]/div/content/div/label[' + chessClubRating + ']/div[2]/div').click();
//*[@id="mG61Hd"]/div/div[2]/div[2]/div[1]/div[2]/div/content/div/label[5]/div[2]/div
}
// Say yes or no to weekly gatherings
if (weeklyAttendace){
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[5]/div[2]/div/content/div/label[1]/div/div[1]').click();
} else {
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[5]/div[2]/div/content/div/label[2]/div/div[1]').click();
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[6]/div[2]/div/content/div/div/label/div/div[1]').click();
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[6]/div[2]/div/content/div/div/div/content/div/div/div[1]/input').value = reasonForNoWeeklyAttendance;
}
// Say no to playing different games
for (i = 7; i < 11; i++){
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[' + i + ']/div[2]/div/content/div/label[' + otherGamesRating + ']/div[2]/div').click();
}
// Say yes or no to joining the chess club next year
if (chess2k17 = true){
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[11]/div[2]/div/content/div/label[1]/div/div[1]').click();
} else {
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[11]/div[2]/div/content/div/label[3]/div/div[1]').click();
}
// Give some general Feedback
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[12]/div[2]/div[1]/div[2]/textarea').value = generalFeedback;
// Suggest Something for 2k17
getElementByXpath('//*[@id="mG61Hd"]/div/div[2]/div[2]/div[13]/div[2]/div[1]/div[2]/textarea').value = suggestionsFor2K17;
@bijij

This comment has been minimized.

Copy link
Owner Author

@bijij bijij commented Nov 2, 2016

You BasicLee, open the form, then open the console in Chrome, then paste and press enter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment