From a97f5361c4ea059f71522fe88320c00fe6959cdc Mon Sep 17 00:00:00 2001 From: PAlexanderFranklin Date: Sun, 12 Nov 2023 15:47:26 -0800 Subject: [PATCH] Fix null quest values, save unparsed activities --- src/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 099964b..eabd3f3 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,6 @@ async function main() { await page.setRequestInterception(true) let usefulRequestHeaders = {} - let testForHeaders = () => !!usefulRequestHeaders["content-type"] page.on("request", (request) => { let url = request.url() if (url.includes("getWebActivityFeed")) { @@ -47,7 +46,11 @@ async function main() { } }) - await loginToUber(page, options, testForHeaders) + await loginToUber( + page, + options, + () => !!usefulRequestHeaders["content-type"], + ) let uberJSON = [] @@ -82,7 +85,7 @@ async function main() { ).toISOString(), pickupAddress: activity.tripMetaData?.pickupAddress, dropOffAddress: activity.tripMetaData?.dropOffAddress, - total: Number(activity.formattedTotal), + total: activity.formattedTotal, type: activity.activityTitle, } } @@ -90,6 +93,7 @@ async function main() { // Trip or Share return await processTrip(activity, usefulRequestHeaders) } + return { unparsedActivity: activity } }) if (trips) { let tripResults = await utils.settlePromises(trips)