Back to APIs list

Hacker News API examples & templates

Use these vals as a playground to view and fork Hacker News API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
roramigator avatar
roramigator
hackerNewsDigest
Cron
Hacker News Digest Fork this val to get an email like this in your inbox!
4
elsif_maj avatar
elsif_maj
topHNThreadByHour
Email
// set at Thu Nov 30 2023 14:22:53 GMT+0000 (Coordinated Universal Time)
0
mihai avatar
mihai
hackerNewsDigest
Cron
Forked from roramigator/hackerNewsDigest
0
stevekrouse avatar
stevekrouse
hackerNewsDigest
Cron
Forked from roramigator/hackerNewsDigest
1
pomdtr avatar
pomdtr
hackernews
Script
An interactive, runnable TypeScript val by pomdtr
0
janpaul123 avatar
janpaul123
valle_tmp_42249988258651369468890296933772
HTTP
// Initialize sample stories and store them in blob storage
0
janpaul123 avatar
janpaul123
valle_tmp_4674518929569141580380318140624
HTTP
// Initialize sample stories and store them in blob storage
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
alexdphan avatar
alexdphan
hackerNewsSearch
HTTP
An interactive, runnable TypeScript val by alexdphan
0
mikker avatar
mikker
checkHackerNewsForPatreon
Cron
// This val checks Hacker News for news about Patreon, Buy Me A Coffee, and Ko-fi,
0
janpaul123 avatar
janpaul123
valle_tmp_066236646798213175732405021232028
HTTP
// This val creates a simple Hacker News clone with clickable story titles.
0
cocodrilette avatar
cocodrilette
hnResume
Cron
Send the top 5 HackerNews post to your email every day at a given Datetime.
0
stevekrouse avatar
stevekrouse
hnTopStory
HTTP
// Get the title of the top story on Hacker News
1
janpaul123 avatar
janpaul123
valle_tmp_7637538511907467267008900862313
HTTP
* Hacker News Clone (HTML frontend) * This script sets up an HTTP Val to serve a simple HTML page that mimics Hacker News. * The page contains static, fake example stories for now.
0
browserbase avatar
browserbase
TopHackerNewsDailyEmail
Cron
Browserbase Browserbase offers a reliable, high performance serverless developer platform to run, manage, and monitor headless browsers at scale. Leverage our infrastructure to power your web automation and AI agents. Get started with Browserbase for free here . If you have any questions, reach out to developer@browserbase.com.
0
sarahxc avatar
sarahxc
slackScout
Cron
Slack scout sends a slack notification every time your keywords are mentioned on Twitter, Hacker News, or Reddit. Get notified whenever you, your company, or topics of interest are mentioned online. Built with Browserbase . Inspired by f5bot.com . Full code tutorial . Getting Started To run Slack Scout, you’ll need a Browserbase API key Slack Webhook URL: setup here Twitter Developer API key Browserbase Browserbase is a developer platform to run, manage, and monitor headless browsers at scale. We’ll use Browserbase to navigate to, and scrape our different news sources. We’ll also use Browserbase’s Proxies to ensure we simulate authentic user interactions across multiple browser sessions . Get started with Browserbase for free here . Twitter We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. If you decide to use Browserbase, we can lend our token. Comment below for access. Once you have the SLACK_WEBHOOK_URL , BROWSERBASE_API_KEY , and TWITTER_BEARER_TOKEN , input all of these as Val Town Environment Variables . Project created by Sarah Chieng and Alex Phan 💌
14