本文へスキップ
動画上級

Hacker News のブラウザレンダリング + Workers AI + メール自動化

Hacker News をスクレイピングし、Workers AI と Llama 3.3 で AI 要約を作成して、Cloudflare の開発者プラットフォームでパーソナライズされたメールダイジェストを届ける自動化システムを構築します。

著者
Cloudflare Developers
公開日
2025年6月27日
再生時間
10:10
YouTube で見る

この紹介文は現在英語版のみです。

This video demonstrates an innovative project that automates the entire workflow of scraping Hacker News, generating AI-powered summaries of trending stories, and delivering personalized email digests—all orchestrated seamlessly using Cloudflare’s comprehensive developer platform.

Project Overview & Architecture

The system showcases a sophisticated automation pipeline built entirely on Cloudflare services, demonstrating how modern edge computing can power intelligent content aggregation and distribution.

Source Code & Live Demo

The complete implementation of this project is available as an open-source repository, providing developers with a comprehensive reference for building similar automation systems:

🔗 GitHub Repository: hackernews-top10-workersai-browserrendering-email

🌐 Live Demo: hacker-news-email-worker.lizziepika.workers.dev

The repository includes complete source code, configuration files, and detailed setup instructions for deploying your own instance of this intelligent news aggregation system.

Core Functionalities & Technologies

  • Intelligent Web Scraping:

    • Leverages Cloudflare Workers integrated with the Browser Rendering API and Cloudflare Puppeteer to dynamically scrape the top 10 articles from news.ycombinator.com
    • Employs advanced DOM manipulation techniques to precisely extract story titles, links, and metadata
    • Ensures reliable data collection through robust error handling and retry mechanisms
  • AI-Powered Content Analysis:

    • Harnesses Workers AI with the powerful Llama 3.3 model to generate intelligent summaries and insightful analyses of trending stories
    • Features a customizable tone system that allows users to personalize their AI-generated content through an intuitive frontend interface (supporting diverse styles from Ted Lasso’s optimistic warmth to Steven A. Smith’s energetic commentary)
    • Optimizes performance and reduces costs by caching AI responses through AI Gateway, ensuring efficient resource utilization
  • Dynamic Web Interface:

    • Built with the lightweight Hono framework, the web application elegantly presents the top 10 Hacker News stories alongside their AI-generated summaries
    • Dynamically adapts content presentation based on user-selected tone preferences
    • Processes and sanitizes AI output, delivering clean, well-formatted HTML for optimal user experience
  • Automated Email Distribution System:

    • Implements a sophisticated backend automation system powered by Cron Triggers that executes hourly scheduled tasks
    • Autonomously fetches the latest trending stories and generates specialized AI-powered email summaries (distinctly crafted for email consumption, separate from web display content)
    • Seamlessly delivers personalized email digests with the subject “Top 10 Hacker News Stories” using Cloudflare Email Routing
    • Maintains consistency in tone customization across both web and email platforms
  • Intelligent Browser Lifecycle Management:

    • Utilizes Cloudflare Durable Objects to implement sophisticated browser instance management
    • Orchestrates the complete browser lifecycle—intelligent launching, persistent session management, and graceful shutdown—optimizing resource allocation for web scraping operations
    • Ensures high availability and performance through stateful browser management
  • Extensible Architecture & Vision:

    • While the creator fondly recalls the early days of Hacker News, the project demonstrates that the Browser Rendering API’s capabilities extend far beyond a single website
    • The modular architecture enables easy adaptation for scraping and analyzing content from virtually any web platform
    • Represents a blueprint for building scalable, intelligent content aggregation systems

Technical Excellence

This project exemplifies the power of Cloudflare’s integrated developer ecosystem, showcasing how edge computing, AI services, automated scheduling, and email delivery can be orchestrated to create a sophisticated, production-ready content automation platform. The implementation demonstrates best practices in serverless architecture, intelligent caching, and scalable web scraping methodologies.

さらに学ぶ