I'm trying to use firebase cloud function to build a price tracker to track from a webpage
let's say I want to track this product: https://www.jarir.com/sa-en/apple-magic-keyboard-mouse-combo-547294.html
- How to load this page in my cloud function project using typeScript lang and save it in a
const
as an html or string ?
Here is i'm using pubsub
to trigger this event every 30 minutes:
import * as functions from 'firebase-functions';
import admin = require('firebase-admin');
export const priceTracker = functions.pubsub.schedule('every 30 minutes')
.onRun(async(context) => {
// 1- How to load this page: https://www.jarir.com/sa-en/apple-magic-keyboard-mouse-combo-547294.html
// and save it in a `const` as an html or string
// 2- How to extract the price from the html const and save the result into my firestore database
});
Thanks in advance