Skip to content

Instantly share code, notes, and snippets.

@schnabear
Created November 29, 2016 04:30
Show Gist options
  • Save schnabear/b2dedacd7a4ac0b8bcd0fc96a2d64319 to your computer and use it in GitHub Desktop.
Save schnabear/b2dedacd7a4ac0b8bcd0fc96a2d64319 to your computer and use it in GitHub Desktop.
UBI30 Giveaway
<!DOCTYPE html>
<html>
<body>
<script>
var totalGiveaway = 30;
var totalLoaded = 0;
var body = document.querySelector('body');
for (var i = 1; i <= totalGiveaway; i++) {
var source = 'https://30days.ubi.com/Promotion/RedeemCode/?giveAwayId=giveaway';
if (i > 1) {
source = source + i;
}
var iframe = document.createElement('iframe');
iframe.src = source;
iframe.onload = function() {
totalLoaded++;
if (totalLoaded >= totalGiveaway) {
window.location.reload();
}
}
body.appendChild(iframe);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment