Avatar

valdottown

If GitHub Gists could run And AWS Lambda were fun https://www.val.town/
Public vals
3
valdottown avatar
valdottown
templateHackerNewsAlert
Cron
Hacker News Keyword Alerts [TEMPLATE] Get notifications when specific keywords appear in Hacker News posts. This template will help you: Search Hacker News for specific keywords. Send notifications to your preferred platform (Discord, Slack, email, etc.), the default in this template is Discord. Example This val tracks mentions of "Val Town" on Hacker News and sends updates to a Discord webhook. Set Up 1. Fork this Val To start using this template, fork this val by clicking the fork button at the top-right corner of the page. 2. View Source Code The CODE box shows you the the full source code of this val, you may need to scroll down to see it. 3. Customize Keyword In the CODE box below, update the terms or phrases you want to track: query: '"val town" || "val.town"' 5. Set Up Your Notification Method This template uses a Discord webhook for notifications. You can update this to your preferred platform: Create a Discord webhook following this guide . Save your webhook URL in your Val Town environment variables: Key: mentionsDiscord Value: Your Discord webhook URL. Notifications will be sent using this function: await discordWebhook({ url: Deno.env.get("mentionsDiscord"), content, }); To switch to another platform (e.g., Slack, email, or custom webhooks), replace the discordWebhook call with the appropriate integration ((e.g., @std/email , Slack , or anywhere else ) πŸŽ‰ Congrats! You now have a val running that ensures you never miss another Hacker News mention. πŸŽ‰
0
valdottown avatar
valdottown
templateRedditAlert
Cron
Reddit Keyword Alerts [TEMPLATE] Get notifications when specific keywords appear in Reddit posts. This template will help you: Search Reddit for specific keywords within a defined time range. Send notifications to your preferred platform (Discord, Slack, email, etc.) Reddit does not have an API that allows users to scrape data, so we are doing this with the Google Search API, Serp . Example This val tracks mentions of "Val Town" and related terms on Reddit, filtering results from the last 7 days and sending alerts to a Discord webhook. Set Up 1. Fork this Val To start using this template, fork this val by clicking the fork button at the top-right corner of the page. 2. View Source Code The CODE box shows you the the full source code of this val, you may need to scroll down to see it. 3. Get a SerpApi Key This template requires a SerpApi key to search Reddit posts via Google search results. Get a SerpApi key : Sign up at SerpApi to create an account. Generate an API key from your account dashboard. Add the SerpApi key to your environment variables : Go to your Val Town environment variables . Add a new key: Key: SERP_API_KEY Value: Your SERP API key. Without this key, the val will not function correctly. 4. Customize Keyword In the CODE box below, update the terms or phrases you want to track: const KEYWORDS = ["val town", "val.town"]; 5. Set Up Your Notification Method This template uses a Discord webhook for notifications. You can update this to your preferred platform: Create a Discord webhook following this guide . Save your webhook URL in your Val Town environment variables: Key: mentionsDiscord Value: Your Discord webhook URL. Notifications will be sent using this function: await discordWebhook({ url: Deno.env.get("mentionsDiscord"), content, }); To switch to another platform (e.g., Slack, email, or custom webhooks), replace the discordWebhook call with the appropriate integration ((e.g., @std/email , Slack , or anywhere else ) πŸŽ‰ Congrats! You now have a val running that ensures you never miss another Reddit mention. πŸŽ‰ NOTE: Usage Limits SerpApi: Free SerpApi accounts have monthly call limits.
0
valdottown avatar
valdottown
templateTwitterAlert
Cron
Twitter/𝕏 Keyword Alerts [TEMPLATE] Get custom notifications when you, your company, or anything you care about is mentioned on Twitter/X, even if they don't tag you directly. This template will help you: Search for specific mentions on Twitter/X using customizable keywords. Deliver notifications wherever you'd like (email, Discord, Slack, Telegram, etc). Example This val tracks mentions of "Val Town" and related terms, excluding noise like retweets and irrelevant accounts. Notifications are sent to a Discord webhook but can be easily reconfigured for other platforms. To see exactly how we use this template at Val Town: https://www.val.town/v/stevekrouse/twitterAlert Set Up 1. Fork this Val To use this template, fork this val on the top right corner of this page. 2. View Source Code The CODE box shows you the the full source code of this val, you may need to scroll down to see it. 3. Customize Query Define what you want to search for by modifying query : const query = "\"val.town\" OR \"val.run\" OR \"val town\" -_ValTown_ -is:retweet -from:valenzuelacity -from:val__run"; Refer to Twitter's search operators to fine-tune your query. 4. Test API call Set isProd = false in the code if you are testing, to ensure there are enough tweets to display. Toggle it back to true when you're ready to run this cron job in production and actuall send notifications. 5. Choose Notification Method This template uses a Discord webhook for notifications, but you can update this to your preferred platform by replacing the discordWebhook call with a call to Slack , @std/email , etc. Create a Discord webhook following this guide . Save your Discord Webhook URL in your Val Town environment variables : Key: mentionsDiscord Value: Your Discord webhook URL. Notifications will be sent using this function: await discordWebhook({ url: Deno.env.get("mentionsDiscord"), content, }); πŸŽ‰ Congrats! You now have a val running that ensures you never miss another Twitter/X mention. πŸŽ‰ NOTE: Usage Limits This val uses the SocialData API for Twitter data: Proxies via Val Town's SocialDataProxy : Limited to 10 cents per day for Val Town Pro users . This API is only for Pro users. Need more calls? Sign up for your own SocialData API token and configure the socialDataSearch function.
0
Next