posting-to-atproto

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Posting to ATProtocol

ATProtocol 发布指南

Short Posts (Bluesky)

短帖发布(Bluesky)

300 grapheme limit. Facets required for @mentions and URLs (byte offsets, not char offsets).
bash
undefined
300字符限制。@提及和URL需要使用Facet(基于字节偏移量,而非字符偏移量)。
bash
undefined

Single post

Single post

uv run python tools/thread.py "Post text here"
uv run python tools/thread.py "Post text here"

Thread

Thread

uv run python tools/thread.py "Post 1" "Post 2" "Post 3"
uv run python tools/thread.py "Post 1" "Post 2" "Post 3"

Reply thread

Reply thread

uv run python tools/thread.py --reply-to at://did:.../app.bsky.feed.post/... "Reply 1" "Reply 2"
uv run python tools/thread.py --reply-to at://did:.../app.bsky.feed.post/... "Reply 1" "Reply 2"

From file (posts separated by '---')

From file (posts separated by '---')

uv run python tools/thread.py --file draft.txt

`tools/thread.py` handles facet detection automatically for @mentions and URLs.
uv run python tools/thread.py --file draft.txt

`tools/thread.py`会自动检测@提及和URL并生成对应的Facet。

Long-form (GreenGale Blog)

长文发布(GreenGale博客)

For content exceeding 300 graphemes. Posts stored as
app.greengale.document
records on PDS, viewable at
https://greengale.app/<handle>/<rkey>
.
bash
uv run python .skills/posting-to-atproto/scripts/publish-greengale.py \
  --title "Post Title" --rkey "url-slug" --file content.md
适用于超过300字符的内容。帖子会以
app.greengale.document
记录的形式存储在PDS上,可通过
https://greengale.app/<handle>/<rkey>
访问。
bash
uv run python .skills/posting-to-atproto/scripts/publish-greengale.py \
  --title "Post Title" --rkey "url-slug" --file content.md

Options

Options

--subtitle "Optional subtitle" --theme github-dark # github-light, dracula, nord, solarized-light, solarized-dark, monokai --visibility public # url (unlisted), author (private)

Same `--rkey` overwrites existing post (uses putRecord). Max 100,000 chars markdown.
--subtitle "Optional subtitle" --theme github-dark # github-light, dracula, nord, solarized-light, solarized-dark, monokai --visibility public # url (unlisted), author (private)

使用相同的`--rkey`会覆盖现有帖子(调用putRecord接口)。Markdown内容最大支持100,000字符。

Facet Details

Facet 详情

python
facets = [{
    'index': {'byteStart': start, 'byteEnd': end},
    'features': [{'$type': 'app.bsky.richtext.facet#mention', 'did': 'did:plc:xxx'}]
}]
For URLs:
app.bsky.richtext.facet#link
with
uri
field.
python
facets = [{
    'index': {'byteStart': start, 'byteEnd': end},
    'features': [{'$type': 'app.bsky.richtext.facet#mention', 'did': 'did:plc:xxx'}]
}]
对于URL:使用
app.bsky.richtext.facet#link
类型,并添加
uri
字段。

Common Errors

常见错误

  • 300 grapheme limit - Split into thread or use GreenGale
  • Mentions not linking - Check facets with correct byte offsets
  • Thread posts not connecting - Verify root and parent refs
  • 300字符限制 - 拆分为线程帖或使用GreenGale发布
  • 提及未正确链接 - 检查Facet是否使用了正确的字节偏移量
  • 线程帖未关联 - 验证root和parent引用是否正确