Skip to content

This Cloudflare Worker emails me an analysis/summary of the top 10 Hacker News stories every hour using Cloudflare Email, Workers AI, AI Gateway, and Browser Rendering. On this page, you can select a tone to get your own summary/analysis of the stories.

Notifications You must be signed in to change notification settings

elizabethsiegle/hackernews-top10-workersai-browserrendering-email

Repository files navigation

Hacker News Top 10 Stories with AI Analysis w/ Hourly Email Summaries

This is a Cloudflare Worker that scrapes the top 10 stories from Hacker News using Browser Rendering, analyzes/summarizes them using Cloudflare Workers AI, displays that according to tone users select via button click, and sends the results via Cloudflare Email Routing every hour (using Cloudflare Cron Triggers).

Features

Scrapes Top 10 Hacker News Stories: Uses Cloudflare's Browser Rendering API to fetch the latest top stories from Hacker News.

AI-Powered Analysis: Generates summaries of the stories using Cloudflare Workers AI with customizable tones (e.g., Ted Lasso or Stephen A. Smith).

Email Delivery: Sends the top stories and AI-generated summaries via Cloudflare Email.

Interactive Web Interface: Provides a web interface to view the top stories and generate AI summaries in different tones.

Setup

Prerequisites

npm install -g wrangler
wrangler login
  • Clone the repo and install dependencies:
git clone /~https://github.com/elizabethsiegle/marchmadness-prediction-analysis-worker
cd marchmadness-prediction-analysis-worker
npm install
"triggers": 
  {
    "crons": ["46 * * * *"] 
  }, // Edit how often you wish the email to send. This runs every hour at the 46th minute
  "send_email": [ //email binding to send the email
    {
      "name": "SEB"
    }
  ],
  "browser": { // browser rendering binding to scrape Hacker News
    "binding": "MYBROWSER"
  },
  "ai": { // AI binding to analyze and summarize the stories with Workers AI
    "binding": "AI"
  },
  "compatibility_flags": ["nodejs_compat"],
  "durable_objects": {
    "bindings": [
      {
        "name": "BROWSERDO",
        "class_name": "BrowserDo"
      }
    ]
  },
  "migrations": [
    {
      "tag": "v1",
      "new_classes": [
        "BrowserDo"
      ]
    }
  ]
  • Deploy the Worker:
npx wrangler deploy

or run locally with npm run dev --remote

About

This Cloudflare Worker emails me an analysis/summary of the top 10 Hacker News stories every hour using Cloudflare Email, Workers AI, AI Gateway, and Browser Rendering. On this page, you can select a tone to get your own summary/analysis of the stories.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published