producthunt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ProductHunt Skill

ProductHunt Skill

Get posts, topics, users, and collections from Product Hunt via the official GraphQL API.
从Product Hunt通过官方GraphQL API获取帖子、话题、用户和合集。

Prerequisites

前提条件

Set access token in
~/.zshrc
:
bash
export PRODUCTHUNT_ACCESS_TOKEN="your_developer_token"
Quick Check:
bash
cd <skill_directory>
python3 scripts/get_posts.py --limit 3
~/.zshrc
中设置访问令牌:
bash
export PRODUCTHUNT_ACCESS_TOKEN="your_developer_token"
从以下地址获取你的令牌:https://www.producthunt.com/v2/oauth/applications
快速检查
bash
cd <skill_directory>
python3 scripts/get_posts.py --limit 3

Commands

命令

All commands run from the skill directory.
所有命令均在skill目录下运行。

Posts

帖子

bash
python3 scripts/get_post.py chatgpt                    # Get post by slug
python3 scripts/get_post.py 12345                      # Get post by ID
python3 scripts/get_posts.py --limit 20                # Today's featured posts
python3 scripts/get_posts.py --topic ai --limit 10     # Posts in topic
python3 scripts/get_posts.py --after 2026-01-01        # Posts after date
python3 scripts/get_post_comments.py POST_ID --limit 20
bash
python3 scripts/get_post.py chatgpt                    # 通过slug获取帖子
python3 scripts/get_post.py 12345                      # 通过ID获取帖子
python3 scripts/get_posts.py --limit 20                # 今日精选帖子
python3 scripts/get_posts.py --topic ai --limit 10     # 话题下的帖子
python3 scripts/get_posts.py --after 2026-01-01        # 指定日期之后的帖子
python3 scripts/get_post_comments.py POST_ID --limit 20

Topics

话题

bash
python3 scripts/get_topic.py artificial-intelligence  # Get topic by slug
python3 scripts/get_topics.py --query "AI" --limit 20 # Search topics
python3 scripts/get_topics.py --limit 50              # Popular topics
bash
python3 scripts/get_topic.py artificial-intelligence  # 通过slug获取话题
python3 scripts/get_topics.py --query "AI" --limit 20 # 搜索话题
python3 scripts/get_topics.py --limit 50              # 热门话题

Users

用户

bash
python3 scripts/get_user.py rrhoover                  # Get user by username
python3 scripts/get_user_posts.py rrhoover --limit 20 # User's posts
bash
python3 scripts/get_user.py rrhoover                  # 通过用户名获取用户
python3 scripts/get_user_posts.py rrhoover --limit 20 # 用户发布的帖子

Collections

合集

bash
python3 scripts/get_collection.py SLUG_OR_ID          # Get collection
python3 scripts/get_collections.py --featured --limit 20
bash
python3 scripts/get_collection.py SLUG_OR_ID          # 获取合集
python3 scripts/get_collections.py --featured --limit 20

API Info

API信息