Avatar

gwoods22

Joined April 15, 2024
Public vals
2
gwoods22 avatar
scraper_template
@gwoods22
Script
Website Scraper Template A basic website scraper template that can be ran on an interval to check for changes. It uses blob storage to save whatever data you'd like to compare the website to. Uses my sendNotification val to alert yourself of the change. Steps to use Add the scrapeURL you would like to scrape and pick a name for your blob storage blobKey . Change the "selector" value to fit your needs. cheerio is used to find the part of the page you'd like to check. Adjust the if statement to detect changes and update your blob Craft a message to be sent with sendNotification() function
gwoods22 avatar
sendNotification
@gwoods22
Script
Push Notification Sender This val can be used in other vals to send notifications to a segment using OneSignal's REST API This is really handy if you want to send push notifications to your phone without building a native app! I built a barebones React PWA that asks for a password then loads the OneSignal Web SDK that I deployed to Netlify for free. OneSignal has easy to follow docs so you can build this functionality into a React, Angular, Vue app or even Wordpress! Then install the PWA on your platform of choice and you're off to the races! Setup Save your ONESIGNAL_TOKEN and SEGMENT_APPID from OneSignal to your Val Town environment variables Import into another val! import sendNotification from "https://esm.town/v/gwoods22/sendNotification";
Next