Last active
August 29, 2015 13:57
-
-
Save dtudury/9501738 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
javascript:(function () { | |
var jsCode = document.createElement('script'); | |
jsCode.setAttribute('src', 'https://rawgit.com/dtudury/9501738/raw/f383c0de610467b8b81d38b263772bb663b04ceb/page2.js'); | |
document.body.appendChild(jsCode); | |
}()); | |
*/ | |
var numbers = "0123456789"; | |
function randomNumber() { | |
return numbers.charAt(Math.floor(Math.random() * numbers.length)); | |
} | |
var vowels = "aeiou"; | |
function randomVowel() { | |
return vowels.charAt(Math.floor(Math.random() * vowels.length)); | |
} | |
var consonants = "bcdfghjklmnpqrstvwxyz"; | |
function randomConsonant() { | |
return consonants.charAt(Math.floor(Math.random() * consonants.length)); | |
} | |
function randomPhone(min, max) { | |
var b = Math.floor((max - min) * Math.random()) + min; | |
var phone = ""; | |
for (var i = 0; i < b; i++) { | |
phone += randomNumber(); | |
} | |
return phone; | |
} | |
function randomName(min, max) { | |
var a = Math.floor(2 * Math.random()); | |
var b = Math.floor((max - min) * Math.random()) + min + a; | |
var name = ""; | |
for (var i = a; i < b; i++) { | |
if(i % 2) { | |
name += randomVowel(); | |
} else { | |
name += randomConsonant(); | |
} | |
} | |
return name; | |
} | |
var first = randomName(4, 8); | |
var last = randomName(5, 10); | |
var biz = randomName(10, 10); | |
var email = "david.tudury+" + biz + "@voxer.com" | |
document.getElementById("credit-card").value = "4111111111111111"; | |
document.getElementById("security-number").value = "123"; | |
document.getElementById("expiry-month").value = Math.floor(Math.random() * 12) + 1; | |
document.getElementById("expiry-year").value = 2020; | |
var billing_address = document.getElementById("billing-address"); | |
if (billing_address) billing_address.value = randomPhone(2, 5) + " " + randomName(5, 10); | |
var billing_city = document.getElementById("billing-city"); | |
if (billing_city) billing_city.value = randomName(5, 10); | |
var billing_zip = document.getElementById("billing-zip"); | |
if (billing_zip) billing_zip.value = randomPhone(5, 5); | |
var billing_state = document.getElementById("billing-state"); | |
if (billing_state) billing_state.value = "CA"; | |
var billing_terms = document.getElementById("billing-terms"); | |
if (billing_terms) billing_terms.checked = true; | |
var accept_terms = document.getElementById("accept-terms"); | |
if (accept_terms) accept_terms.checked = true; | |
document.getElementById("credit-card").click(); | |
document.getElementById("security-number").click(); | |
document.getElementsByClassName("signup-step2")[0].getElementsByClassName("next-footer")[0].getElementsByClassName("next-button")[0].focus(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment