Last active
October 24, 2017 16:38
-
-
Save otaavioo/65e6c09f0ef8b2677dfb16c8cc6b2098 to your computer and use it in GitHub Desktop.
Creates an account at Operand Site
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
var name = 'otavio'; | |
var isHomePage = function() { | |
return window.location.href.indexOf('contratar') === -1; | |
}; | |
var createAccountStepZero = function() { | |
var text = 'Qual a sequência do email? Ex.: ' + name + '[sequencia]@mailinator.com', | |
iSequence = prompt(text, getLastSequenceNumber()); | |
if (iSequence !== null) { | |
setStorage(true, iSequence); | |
} | |
}; | |
var getLastSequenceNumber = function(isCreatingAccount, iSequence) { | |
if (localStorage.getItem('iSequence') === null || localStorage.getItem('iSequence') === '') { | |
return ''; | |
} | |
return parseInt(localStorage.getItem('iSequence')) + 1; | |
} | |
var setStorage = function(isCreatingAccount, iSequence) { | |
localStorage.setItem('isCreatingAccount', isCreatingAccount); | |
localStorage.setItem('iSequence', iSequence); | |
}; | |
var createAccount = function() { | |
if (!isCreatingAccount()) { | |
return; | |
} | |
var vm = ko.dataFor(document.body), | |
iSequence = localStorage.getItem('iSequence'); | |
vm.sEmail(name + iSequence + '@mailinator.com'); | |
$('.btn.btn-default').click(); | |
setTimeout(function() { | |
vm.sUserName(name + iSequence); | |
vm.sOccupation('CEO / Diretor'); | |
vm.sEmail(name + iSequence + '@mailinator.com'); | |
vm.sPassword('123456'); | |
setTimeout(function() { | |
vm.goToStepTwo(); | |
setTimeout(function() { | |
vm.sCompanyName(name + iSequence); | |
vm.sCompanyPriority('Outro'); | |
vm.sOccupationArea('Publicidade e Propaganda'); | |
vm.iCompanyNumber('(00) 00000-0000'); | |
vm.iUserQuantity('Acima de 100'); | |
setTimeout(function() { | |
vm.goToStepThree(); | |
setTimeout(function() { | |
vm.sUserToInvite(name + iSequence + '[email protected]'); | |
$('#btnInvite').click(); | |
vm.sUserToInvite(name + iSequence + '[email protected]'); | |
$('#btnInvite').click(); | |
setTimeout(function() { | |
vm.goToStepFour(); | |
setStorage(false, iSequence); | |
}, 1000); | |
}, 2000); | |
}, 1500); | |
}, 2000); | |
}, 1500); | |
}, 1500); | |
}; | |
var isCreatingAccount = function() { | |
return localStorage.getItem('isCreatingAccount') === 'true'; | |
}; | |
$(document).ready(function() { | |
if (isHomePage()) { | |
createAccountStepZero(); | |
} | |
createAccount(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment