From e074b934a577e2e83807f1fefcba91d7fb99a5e5 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 15 Oct 2021 11:57:19 +0200 Subject: [PATCH] fix: Wildeford tweaks --- src/platforms/wildeford-fetch.js | 5 +++-- src/utils/.mergeEverything.js.swp | Bin 12288 -> 0 bytes 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 src/utils/.mergeEverything.js.swp diff --git a/src/platforms/wildeford-fetch.js b/src/platforms/wildeford-fetch.js index 6347bda..b9f491c 100644 --- a/src/platforms/wildeford-fetch.js +++ b/src/platforms/wildeford-fetch.js @@ -8,7 +8,6 @@ import { calculateStars } from "../utils/stars.js" import {upsert} from "../utils/mongo-wrapper.js" /* Definitions */ -const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || getCookie("google-api") // See: https://developers.google.com/sheets/api/guides/authorizing#APIKey const SHEET_ID = "1xcgYF7Q0D95TPHLLSgwhWBHFrWZUGJn7yTyAhDR4vi0" // spreadsheet key is the long id in the sheets URL const endpoint = `https://docs.google.com/spreadsheets/d/${SHEET_ID}/edit#gid=0` // https://docs.google.com/spreadsheets/d/1xcgYF7Q0D95TPHLLSgwhWBHFrWZUGJn7yTyAhDR4vi0/edit#gid=0&range=C4 @@ -44,7 +43,8 @@ async function fetchGoogleDoc(google_api_key){ let data = rows[i]._rawData if(data.length == 0) isEnd = true; if(!isEnd){ - let result = ({...formatRow(data), "url": endpoint + `&range=A${i}`}) + let result = ({...formatRow(data), "url": endpoint + `&range=A${i + 2}`}) + // +2: +1 for the header row, +1 for starting at 1 and not at 0. // console.log(result) results.push(result) @@ -115,6 +115,7 @@ export async function wildeford_inner(google_api_key) { //example() export async function wildeford(){ + const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY || getCookie("google-api") // See: https://developers.google.com/sheets/api/guides/authorizing#APIKey await applyIfCookieExists(GOOGLE_API_KEY, wildeford_inner) } diff --git a/src/utils/.mergeEverything.js.swp b/src/utils/.mergeEverything.js.swp deleted file mode 100644 index a9f24bca6e37fb23d697b0e8619d6ebae15d2f10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2Kabr+5WqJnLIDYYeQdeit@an$eMb(<2d)}AurZXC^H2uY#I?dj;~})= zGL#)e)!NfC>DE1hzuT%Guxy6vi#`?18h8&G4&QD;?#~2ky-M`__WbX9A9T=c82N*jBO`Y!$V$}Ia0QI?a z5B9B$E-EvZu>}tjXNKji&6w@Up~8S&#C9v64iG44IG_qoGe5D!62`Mdr}`WW&`h$t z|EbJ3MNv%pT)IAa3DM(tF-|21P`+yK$;qIY_LGxwO+Lm|VO0mSV(GNav$@P>+ZiQ8 zCCgKgQx@2oO2vE`oF${Py*jwH2@tokRRL=zn|~;DER_sSTSOz%UxKQ0bn#IbnnoW{ z1S}>eF8EcthF$?1@^@C~;+rS`u9s8ev7yOj3WCS8y^}s<;|@k4w;9fMdu1wD!%+lF zbPgdlN_$#XZs=+HJFPJ>ng)+x4C!EWrD>2D#E^W9Qrjj|DcbD?r^2xOcN zI#bhnp`XDTowy!s-|FOS;at5O>IL;an`e_s8d=e)_P7V%X`5WElnJe-&qmdU-mM@- zp_@_-W(?`@G+Fe{9CymEAXU+Os5Rb#q