Hacker News Keyword Alerts [TEMPLATE]

Get notifications when specific keywords appear in Hacker News posts.

This template will help you:

  1. Search Hacker News for specific keywords.
  2. 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. Screenshot 2025-01-12 at 10.57.48 AM.png


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. Screenshot 2025-01-10 at 1.22.10 PM.png


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. image.png


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 (you can find this on the left sidebar):

  • 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. 🎉