mcpField
H
hacker-news-scraper

hacker-news-scraper

github.com/gooseworks-aiデータ・データベース1.3k59 回インストール3 日前に更新
リポジトリ

hacker-news-scraper について

Algolia HN Search API を使って Hacker News を検索する Python のコマンドラインスキルです。日付や投稿種別、キーワードで絞り込み、points 順に JSON または要約を出力します。

主な機能

  1. 01クエリによる Hacker News 検索
  2. 02日付と投稿種別での絞り込み
  3. 03任意のキーワードフィルター
  4. 04points 順の結果並べ替え
  5. 05JSON または要約の出力

活用シーン

  1. 01話題に関する最近の議論を探す
  2. 02Ask HN や Show HN の投稿を確認する
  3. 03キーワードに合うストーリーを集める

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/gooseworks-ai/goose-skills --skill hacker-news-scraper

インストール後、Claude Code で/hacker-news-scraperを入力して読み込まれたか確認します。

同梱ファイルscripts/search_hn.pyskill.meta.json

詳細

Hacker News スクレイパー

無料の Algolia HN Search API を使って Hacker News を検索します。Apify のトークンや API キーは不要です。

クイックスタート

依存関係は pip install requests のみです。

# Stories about AI content marketing in last week
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "AI content marketing" --days 7

# Show HN posts in last month (summary view)
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "" --tags show_hn --days 30 --output summary

# Comments mentioning a specific tool
python3 skills/hacker-news-scraper/scripts/search_hn.py \
  --query "LangChain" --tags comment --days 14 --max-results 20

スクリプトの仕組み

  1. Algolia HN Search API(search_by_date エンドポイント)にクエリを送信します
  2. サーバー側で日付を絞り込むために numericFilters=created_at_i>{unix_timestamp} を使用します
  3. 最大結果数に達するまでページネーションします
  4. 結果を一貫したスキーマに正規化します
  5. 任意でキーワードによる絞り込みを適用します(クライアント側)
  6. ポイント数の降順で並べ替え、JSON または概要を出力します

CLI リファレンス

フラグデフォルト説明
--query必須検索クエリ
--days7何日前まで検索するか
--tagsstoryアイテムの種類:story、comment、ask_hn、show_hn
--max-results50返す結果の最大数
--keywordsなし追加の絞り込みキーワード(カンマ区切り、OR ロジック)
--outputjson出力形式:json または summary

出力形式

{
  "id": "12345678",
  "title": "Show HN: My new tool",
  "url": "https://example.com",
  "author": "username",
  "points": 42,
  "num_comments": 15,
  "created_at": "2026-02-18T12:00:00.000Z",
  "hn_url": "https://news.ycombinator.com/item?id=12345678",
  "text": ""
}

コスト

無料です。 API キーもレート制限も(常識的な範囲内では)なく、Apify のクレジットも不要です。

コメント