To do batch audits from Google Sheet with Lighthouse and put all scores in Firestore. Also the screenshot of the web in Firebase Storage. You can modify the database and storage by modify the Tester module
Setup:
- Install all depedencies
npm install
- Setup a Firebase project and use the Firebase Admin SDK.
- Download the service account credentials to your project directory to connect with Firebase. Follow the instruction in Firebase Admin SDK setup and save the credentials as
service-account.json
. - Setup Google API Node SDK.
- You will need a
CLIENT_ID
,CLIENT_SECRET
andREDIRECT_URL
. You can find these pieces of information by going to the Google Developer Console, clicking your project --> APIs & auth --> credentials. Save it ascredentials.json
in your project directory. - Don't forget to edit the
spreadsheetID
inindex.js
to your Google Sheet document. The Google Sheet document only has 2 columns like belows:
------------------------------------------------
| Url | Category |
------------------------------------------------
| https://xxx.com | media |
------------------------------------------------
| https://xxx.com | media |
------------------------------------------------
- Run the script
node index.js
- You need to manually copy paste the authorization URL to browser to allow access to your Google Sheet.
- Check the result in your Firestore Database