diff --git a/options.json b/options.json new file mode 100644 index 0000000..fea537e --- /dev/null +++ b/options.json @@ -0,0 +1,3 @@ +{ + "uberPhoneNumber": "4444567891" +} diff --git a/src/index.js b/src/index.js index 9564b8c..3ee1337 100644 --- a/src/index.js +++ b/src/index.js @@ -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)