360 Secure SkillHub
360 安全技能中心

Hacker News Poster

该 Skill 通过 scripts/hn.py 提供 Hacker News 写操作命令行:登录、发布链接帖或文本帖、评论与回复、编辑评论、更新个人资料,成功时输出 JSON。需设置 HN_USERNAME、HN_PASSWORD 环境变量,会话 cookie 以明文保存在本地文件,路径可用环境变量更改。仅覆盖写操作,读取内容需借助其他技能或 HN API。

saikatkumardey
saikatkumardey
热度 28.31
最近更新 2026-05-17 12:17:33
分类:营销依赖:代码执行 / 第三方 API / 读写文件应用场景:社交媒体 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hacker-news-poster
Metadata
name
hacker-news-poster
description
Post, comment, and interact on Hacker News. Use when the user asks to submit a Show HN, post a story, comment on an HN thread, edit a comment, or update an HN profile. Requires HN_USERNAME and HN_PASSWORD environment variables. Persists session cookies to ~/.hn_cookies.txt (configurable via HN_COOKIE_FILE env var).

Hacker News Poster

Submit stories, comment on threads, edit comments, and update profiles on Hacker News.

Setup

Required Environment Variables

Variable Required Description
HN_USERNAME Yes Hacker News username
HN_PASSWORD Yes Hacker News password
HN_COOKIE_FILE No Cookie storage path (defaults to ~/.hn_cookies.txt)

Security Note

Session cookies are stored in plaintext at HN_COOKIE_FILE (or ~/.hn_cookies.txt). These are standard HN session tokens. Delete the file to clear the session.

CLI

All commands go through scripts/hn.py. Always login first per session.

# login (reads HN_USERNAME/HN_PASSWORD from env)
python3 scripts/hn.py login

# submit a link post
python3 scripts/hn.py submit --title "Show HN: My Tool" --url "https://example.com"

# submit a text post (Ask HN, etc.)
python3 scripts/hn.py submit --title "Ask HN: Question?" --text "body text here"

# comment on a story or reply to a comment
python3 scripts/hn.py comment --parent 12345678 --text "your comment"

# edit a comment (only within HN's edit window)
python3 scripts/hn.py edit --id 12345678 --text "updated comment"

# update profile about section
python3 scripts/hn.py profile --username youruser --about "your bio"

All commands output JSON on success ({"ok": true, ...}) and print errors to stderr.

Notes

  • HN rate-limits submissions and comments. If you get a rate limit error, wait a few minutes.
  • Comments can only be edited within ~2 hours of posting.
  • The submit command returns the new item id and url on success.
  • Session cookies are stored in ~/.hn_cookies.txt to avoid re-authenticating on every command. Delete this file to clear the session.
  • For reading HN (search, top stories, comments), use the existing hacker-news skill or the HN API directly. This skill is write-only.

Combining with the read-only HN skill

  1. use the hacker-news skill to browse/search stories and find interesting threads
  2. use this skill to login and post/comment