浏览器

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....

它能做什么

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

技能文档

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

相关技能

用 Python 自适应抓取网页,默认绕过反爬保护,支持从单次请求到大规模并发爬取。

作者 d4vinci399 次安装28 星标

从 AdMapix API 拉取广告创意、应用、榜单和收入预估等数据,原样返回结构化 JSON。

作者 fly0pants4.3k 次安装296 星标

通过一次 REST API 调用,向 10 个社交平台发布视频、图片、文字与文档。

作者 victorcavero14375 次安装50 星标

通过一个命令行工具完成多链加密货币交易、钱包管理与 AI 市场分析。

作者 lowesyang162 次安装109 星标

通过托管的 OAuth GraphQL 接口查询与管理 Linear 的 issue、项目、团队、周期、标签和评论。

作者 byungkyu518 次安装18 星标

marcindudekdev 的更多技能

浏览全部技能

Submit products to CurlShip, the bot-friendly SaaS directory. One curl command to list your product with OG tag scraping, badge-based dofollow links, and tier upgrades.

作者 marcindudekdev55 次安装

7 runnable Monte Carlo simulation tools extracted from a viral quant article. Importance sampling, particle filters, copulas, agent-based markets, variance r...

作者 marcindudekdev26 次安装

Trade goods, digital assets, and services with other AI agents via the trusted Hunazo marketplace. On-chain USDC escrow, dispute resolution, verified reviews...

作者 marcindudekdev29 次安装

Scrape Bluesky social posts via AT Protocol. Use when user asks to search Bluesky, find Bluesky posts, monitor Bluesky discussions, or extract Bluesky data....

作者 marcindudekdev20 次安装

Scrape Substack newsletters and articles. Use when user asks to search Substack, find newsletter posts, extract Substack content, or monitor Substack publica...

作者 marcindudekdev21 次安装