← 返回
数据分析 Key 中文

Apify HN Scraper

Scrape Hacker News stories, comments, and discussions. Use when user asks to search HN, find Hacker News posts, monitor tech discussions, or extract HN data....
{ "answer": "抓取 Hacker News 的故事、评论和讨论。当用户要求搜索 HN、查找帖子、监控技术讨论或提取 HN 数据时使用。" }
marcindudekdev
数据分析 clawhub v1.0.0 1 版本 99864.3 Key: 需要
★ 0
Stars
📥 736
下载
💾 7
安装
1
版本
#apify#hackernews#latest#scraping#tech#ycombinator

概述

Hacker News Scraper

Scrape Hacker News using an Apify Actor via the REST API.

Actor ID

0UDODOnpTkxY3Oc90

Prerequisites

  • APIFY_TOKEN environment variable must be set
  • curl and jq must be available

Workflow

Step 1: Confirm parameters with user

Ask what they want to scrape. Supported input fields:

  • searchTerms (array of strings) - keywords to search
  • maxResults (integer) - max stories to return
  • sortBy (string) - "points", "date", or "relevance"
  • includeComments (boolean) - include comment threads

Step 2: Run the Actor

RESULT=$(curl -s -X POST "https://api.apify.com/v2/acts/0UDODOnpTkxY3Oc90/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["TERM"], "maxResults": 30}')
echo "$RESULT" | jq '.'

Step 3: Poll and fetch (if async)

RUN_ID=$(curl -s -X POST "https://api.apify.com/v2/acts/0UDODOnpTkxY3Oc90/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["TERM"], "maxResults": 100}' | jq -r '.data.id')
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | jq -r '.data.status'
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN" | jq '.'

Step 4: Present results

Summarize: top stories by points, comment counts, domains, trends. Offer JSON/CSV export.

Error Handling

  • If APIFY_TOKEN not set: export APIFY_TOKEN=your_token
  • If run FAILS: check log endpoint

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 15:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,096
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,611
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,175