• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
kutay25

kutay25

curated-hacker-news-to-mail

Public
Like
curated-hacker-news-to-mail
Home
Code
3
README.md
C
hn-best-comments-feed.ts
H
test-hn-feed.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
test-hn-feed.ts
https://kutay25--77073aca97b611f0933b0224a6c84d84.web.val.run
README.md

Hacker News Best Comments Daily Email Feed

A daily email digest that delivers the best comments from Hacker News directly to your inbox, beautifully formatted and ready to read.

Features

  • πŸ“§ Daily Email Delivery: Automatically sends a curated digest of HN's best comments
  • 🎨 Beautiful Formatting: Clean HTML email with proper styling and text fallback
  • πŸ“Š Rich Metadata: Shows author, points, date, and comment content
  • πŸ”— Direct Links: Easy access to full discussions on Hacker News
  • ⚑ Reliable: Built-in error handling and notifications

How It Works

The system fetches the RSS feed from hnrss.org/bestcomments, which aggregates newly emerging high-score comments across Hacker News. This feed typically contains around a dozen items daily, corresponding to 4-5 articles β€” a perfect amount for daily reading.

Files

  • hn-best-comments-feed.ts - Main cron job that runs daily to fetch and email the digest
  • test-hn-feed.ts - HTTP endpoint for manually testing the email functionality

Email Format

Each email includes:

  • Header: Date and total number of comments
  • Comment Cards: Each comment shows:
    • Title/excerpt of the comment
    • Author name and points received
    • Publication date
    • Truncated content (full content available via link)
    • Direct link to the full comment thread
  • Footer: Attribution and source information

Setup

The cron job is configured to run daily. To set the schedule:

  1. Go to the Val Town web UI
  2. Navigate to the hn-best-comments-feed.ts file
  3. Set your preferred daily schedule (e.g., 0 8 * * * for 8 AM daily)

Testing

Use the test endpoint to manually trigger the email:

  • Visit the test-hn-feed.ts HTTP endpoint
  • This will immediately fetch and send the current digest

Technical Details

  • RSS Source: hnrss.org/bestcomments
  • Email Service: Val Town's built-in email service
  • Parsing: Custom XML/RSS parser for extracting comment data
  • Formatting: Responsive HTML email with text fallback
  • Error Handling: Automatic error notifications if the feed fails

Why This Feed?

As mentioned in the original request, HN's "Best Comments" feed is particularly valuable because:

  1. Quality Curation: High-score comments are typically well-researched and insightful
  2. Discovery: Comments often lead to quality discussions and posts outside your usual interests
  3. Manageable Volume: ~12 items daily is perfect for regular consumption
  4. Diverse Perspectives: Exposes you to discussions across various topics and domains

The feed serves as an excellent way to stay connected with the HN community's most valuable contributions without the overwhelming volume of the main feed.

HTTP
  • test-hn-feed.ts
    kutay25--77…84.web.val.run
Cron
  • hn-best-comments-feed.ts
Code
README.md
C
hn-best-comments-feed.ts
H
test-hn-feed.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.