Last active
September 7, 2016 19:25
-
-
Save drewsberry/5b1129255dd0bb57c026ef4656ca0056 to your computer and use it in GitHub Desktop.
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
setTimeout(function() { | |
var $textInput = $('input[name="ctl00$cphBody$txtEmailAddressEnter"]'); | |
var $submitButton = $('input[name="ctl00$cphBody$btnNext"]'); | |
var $wheel = $('#wheel'); | |
if ($textInput.length !== 0) { | |
var currentEmail = $textInput.val(); | |
var currentNumber = Number(currentEmail.match(/[\d]+/)[0]); | |
var nextNumber = currentNumber + 1; | |
var nextEmail = currentEmail.replace(currentNumber, nextNumber); | |
console.log("Current email:", currentEmail); | |
console.log("Current number:", currentNumber); | |
console.log("Next email:", nextEmail); | |
$textInput.val(nextEmail); | |
$submitButton.trigger('click'); | |
} else if ($wheel.length !== 0) { | |
setTimeout(function() { | |
var $wheelSrc = $wheel.attr('src'); | |
console.log('Image source:', $wheelSrc); | |
if ($wheelSrc == '/paparewards/images/reveal-0-points.gif') { | |
console.log('You haven\'t won now, trying again...'); | |
history.back(); | |
} else { | |
console.log('Looks like you might\'ve won something!'); | |
} | |
}, 8000); | |
} | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment