Avatar

gwoods22

Joined April 15, 2024
Public vals
4
gwoods22 avatar
gwoods22
newRSSItems
Script
Forked from stevekrouse/newRSSItems
0
gwoods22 avatar
gwoods22
aws_eventbridge_toggler
Script
AWS EventBridge Toggler Script that allows you to enable and disable AWS EventBridge rules Setup In AWS go to the IAM and create a new IAM user for Val Town On the Set permissions page, choose the permissions you require. To get this Val up and running you can attach the AmazonEventBridgeFullAccess policy but it's recommended to limit your permissions. The following policy allows for reading and toggling any EventBridge rule: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "events:DescribeRule", "events:EnableRule", "events:DisableRule" ], "Resource": "*" } ] } Finally add your AWS region as well as yourAccess Key ID and Secret Access Key from your IAM user to Val Town's environment variables as AWS_REGION , AWS_ACCESS_KEY_ID , and AWS_SECRET_ACCESS_KEY
0
gwoods22 avatar
gwoods22
scraper_template
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
1
gwoods22 avatar
gwoods22
sendNotification
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";
1
Next