Skip to main content

Overview

This tutorial demonstrates how to:
  • Fetch and filter top stories from Hacker News API
  • Scrape full article content using web scraping integration
  • Personalize content based on user preferences using AI
  • Generate concise summaries for curated stories
  • Process data in parallel for optimal performance

Task Structure

Let’s break down the task into its core components:

1. Input Schema

First, we define what inputs our task expects:
This schema allows users to:
  • Set a minimum HN score threshold for quality filtering
  • Specify how many stories to include in the final newsletter
  • Define their technology interests for personalization

2. Tools Configuration

Next, we define the external tools our task will use:
We’re using:
  • Direct Hacker News API calls for stories and comments
  • Spider integration for advanced web scraping capabilities

3. Main Workflow Steps

1

Fetch Top Story IDs

This step:
  • Fetches the current top 500 story IDs from Hacker News
  • Extracts the first 50 for processing
2

Fetch Story Details in Parallel

This step:
  • Fetches full details for each story ID
  • Processes 10 stories in parallel for efficiency
  • Extracts successfully fetched story data
3

Filter and Sort Stories

This step:
  • Filters stories by minimum score threshold
  • Sorts by score and takes the top N stories
  • Ensures quality content for the newsletter
4

Scrape Full Article Content

  • smart_mode: Intelligently extracts main content
  • return_format: markdown: Clean, parseable text format
  • proxy_enabled: Avoids rate limiting and blocks
  • filter_output_images/svg: Text-only content
  • readability: Enhanced article parsing
  • parallelism: 4: Balanced to avoid overwhelming target sites
This step:
  • Scrapes full article content for each story
  • Converts to clean markdown format
  • Handles failed scrapes gracefully
5

Fetch Top Comments

This step:
  • Prepares comment IDs (up to 3 per story)
  • Fetches comment details with high parallelism
  • Maintains story-comment relationships
6

Personalize Content

This step:
  • Combines stories with their content and comments
  • Uses AI to score relevance (0-100) based on user preferences
  • Filters stories with relevance >= 60 for high personalization
7

Generate Summaries and Final Output

This step:
  • Generates 100-word AI summaries for each story
  • Formats the final newsletter with all relevant information
  • Includes both article URL and HN discussion URL
YAML

Usage

Here’s how to use this task with the Julep SDK:

Example Output

An example output when running this task with user preferences for AI/ML and Python:
Title: OpenAI Announces GPT-5 with Revolutionary Reasoning Capabilities
URL: https://openai.com/research/gpt-5
HN Discussion: https://news.ycombinator.com/item?id=12345678
Comments: 234
Summary: OpenAI’s GPT-5 demonstrates unprecedented reasoning abilities and multimodal understanding. The model shows significant improvements in code generation, mathematical reasoning, and real-world problem solving. Key breakthrough involves new architecture allowing dynamic computation allocation based on task complexity. Community discusses implications for AI safety and potential applications in scientific research.

Title: Python 3.13 Released with Major Performance Improvements
URL: https://python.org/downloads/release/python-313
HN Discussion: https://news.ycombinator.com/item?id=12345679
Comments: 156
Summary: Python 3.13 brings 40% performance improvements through adaptive bytecode specialization and improved memory management. New features include better error messages, enhanced typing support, and native WASM compilation. Developers report significant speedups in data processing workloads. Discussion highlights compatibility concerns with popular libraries and migration strategies for large codebases.

Title: New ML Framework Achieves 10x Training Speed on Consumer GPUs
URL: https://github.com/fastML/framework
HN Discussion: https://news.ycombinator.com/item?id=12345680
Comments: 189
Summary: FastML framework enables training large language models on consumer hardware through innovative gradient compression and distributed computing techniques. Benchmarks show 10x speedup compared to PyTorch for specific workloads. Framework supports automatic mixed precision and memory-efficient attention mechanisms. Community excited about democratizing ML research but debates production readiness.

Monitoring Execution

Track the execution progress and debug issues:

Customization Ideas

  1. Email Integration: Add email sending to deliver newsletters automatically
  2. Scheduling: Set up periodic execution for daily/weekly newsletters

Next Steps