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).
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.
-
Cloudflare Account: Create one today for free: https://dash.cloudflare.com/sign-up
-
Wrangler CLI: Install and authenticate:
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
-
Cloudflare Email Setup: Configure your domain for Cloudflare Email and set up the necessary bindings.
-
Add the following bindings to your wrangler.jsonc file to interact with your Worker:
- Deploy the Worker:
npx wrangler deploy
or run locally with npm run dev --remote