Add options.json

This commit is contained in:
PAlexanderFranklin 2023-08-30 18:16:18 -07:00
parent 7ef3b56f78
commit 88129ca20d
2 changed files with 9 additions and 2 deletions

3
options.json Normal file
View File

@ -0,0 +1,3 @@
{
"uberPhoneNumber": "4444567891"
}

View File

@ -1,11 +1,12 @@
import puppeteer from "puppeteer-core"
import * as utils from "./utils.js"
import fs from "fs"
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms))
}
async function main() {
let options = JSON.parse(fs.readFileSync("./options.json", "utf8"))
const browser = await puppeteer.launch({
headless: false,
ignoreHTTPSErrors: true,
@ -50,7 +51,10 @@ async function main() {
console.log("Went to Page")
await page.waitForSelector(`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`)
await page.type(`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`, "1234567891")
await page.type(
`input[id="PHONE_NUMBER_or_EMAIL_ADDRESS"]`,
options.uberPhoneNumber ?? "",
)
for (let i = 0; i < 100; i++) {
await sleep(500)