Back to APIs list

Slack API examples & templates

Use these vals as a playground to view and fork Slack API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
daniellevine avatar
daniellevine
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
ben5mills5 avatar
ben5mills5
twitterAlert
Cron
Forked from valdottown/templateTwitterAlert
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
dhruv avatar
dhruv
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
mwsz avatar
mwsz
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
stevekrouse avatar
stevekrouse
effortlessCrimsonDolphin
Script
Forked from stevekrouse/twitterAlert
0
mmcc avatar
mmcc
createDubbingTestAsset
Script
Forked from mux/createDubbingTestAsset
0
stevekrouse avatar
stevekrouse
templateTwitterAlert
Cron
Forked from valdottown/templateTwitterAlert
0
charmaine avatar
charmaine
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
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
samwho avatar
samwho
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
tmcw avatar
tmcw
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
1
ryan_alive avatar
ryan_alive
stirringVioletHookworm
Cron
Forked from ryan_alive/twitterAlert
0
alexdphan avatar
alexdphan
twitterSearch
HTTP
An interactive, runnable TypeScript val by alexdphan
1
marianogenovese avatar
marianogenovese
twitterAlert
Cron
Forked from stevekrouse/twitterAlert
0
dvsj avatar
dvsj
GetWebsiteMetadata
HTTP
You know how when you paste a URL in Twitter or Slack it shows you a nice preview? This val gives you that data. Given a URL, this will return metadata about the website like title , description , imageURL , image as base64 etc. Sample input - paste this in your URL bar https://dvsj-GetWebsiteMetadata.web.val.run?targetURL=https://dvsj.in https://dvsj-GetWebsiteMetadata.web.val.run?targetURL=<your-target-url-here> Sample output: { status: 200, url: "https://dvsj.in", title: "Dav-is-here ➜", description: "Davis' not-so-secret stash", imgUrl: "https://www.dvsj.in/cover-picture.png", imgData: "data:image/png;base64,qwertyblahblah" } FAQ: Why is imgData sent when imgUrl is already present? Because you shouldn't hotlink images from 3rd parties. Store the base64 image on your server and use it in your app. It's unfair to use their server bandwidth and could be a security issue for you if they change the content of the link later.
2