browsing-bluesky

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Browsing Bluesky

浏览Bluesky内容

Access Bluesky content through public APIs and real-time firehose. Supports optional authentication for personalized feeds. Includes account analysis for categorization.
通过公开API和实时firehose访问Bluesky内容。支持可选身份验证以获取个性化订阅源,还包含用于账户分类的账户分析功能。

Implementation

实现方式

Add skill directory to path and import:
python
import sys
sys.path.insert(0, '/path/to/skills/browsing-bluesky')  # or use .claude/skills symlink path
from browsing_bluesky import (
    # Core browsing
    search_posts, get_user_posts, get_profile, get_feed_posts, sample_firehose,
    get_thread, get_quotes, get_likes, get_reposts,
    get_followers, get_following, search_users,
    # Trending
    get_trending, get_trending_topics,
    # Account analysis
    get_all_following, get_all_followers, extract_post_text,
    extract_keywords, analyze_account, analyze_accounts,
    # Authentication utilities
    is_authenticated, get_authenticated_user, clear_session
)
将技能目录添加到路径并导入:
python
import sys
sys.path.insert(0, '/path/to/skills/browsing-bluesky')  # or use .claude/skills symlink path
from browsing_bluesky import (
    # Core browsing
    search_posts, get_user_posts, get_profile, get_feed_posts, sample_firehose,
    get_thread, get_quotes, get_likes, get_reposts,
    get_followers, get_following, search_users,
    # Trending
    get_trending, get_trending_topics,
    # Account analysis
    get_all_following, get_all_followers, extract_post_text,
    extract_keywords, analyze_account, analyze_accounts,
    # Authentication utilities
    is_authenticated, get_authenticated_user, clear_session
)

Authentication (Optional)

身份验证(可选)

Authentication enables personalized feeds (like Paper Skygest) that require knowing who's asking.
身份验证可启用需要识别请求者身份的个性化订阅源(如Paper Skygest)。

Setup

设置步骤

  1. Create an app password at Bluesky: Settings → Privacy and Security → App Passwords
  2. Set environment variables:
    bash
    export BSKY_HANDLE="yourhandle.bsky.social"
    export BSKY_APP_PASSWORD="xxxx-xxxx-xxxx-xxxx"
  1. 在Bluesky创建应用密码:设置 → 隐私与安全 → 应用密码
  2. 设置环境变量:
    bash
    export BSKY_HANDLE="yourhandle.bsky.social"
    export BSKY_APP_PASSWORD="xxxx-xxxx-xxxx-xxxx"

Behavior

行为特性

  • Transparent: All functions work identically with or without credentials
  • Automatic: Auth headers are added opportunistically when credentials exist
  • Graceful: Failed auth silently falls back to public access
  • Secure: Tokens cached in memory only, never logged or persisted
  • 透明化:所有函数无论有无凭据都能以相同方式工作
  • 自动化:当存在凭据时会自动添加身份验证头
  • 优雅降级:身份验证失败时会静默回退到公开访问模式
  • 安全性:令牌仅在内存中缓存,绝不会被记录或持久化存储

Check Auth Status

检查身份验证状态

python
if is_authenticated():
    print(f"Logged in as: {get_authenticated_user()}")
else:
    print("Using public access")
python
if is_authenticated():
    print(f"Logged in as: {get_authenticated_user()}")
else:
    print("Using public access")

Clear session if needed (e.g., switching accounts)

Clear session if needed (e.g., switching accounts)

clear_session()
undefined
clear_session()
undefined

Research Workflows

研究工作流

Investigate a Topic

研究特定话题

Use
search_posts()
with query syntax matching bsky.app advanced search:
  • Basic terms:
    event sourcing
  • Exact phrases:
    "event sourcing"
  • User filter:
    from:acairns.co.uk
    or use
    author=
    param
  • Date filter:
    since:2025-01-01
    or use
    since=
    param
  • Hashtags, mentions, domain links:
    #python mentions:user domain:github.com
Combine query syntax with function params for complex searches.
使用
search_posts()
函数,支持与bsky.app高级搜索匹配的查询语法:
  • 基础关键词:
    event sourcing
  • 精确短语:
    "event sourcing"
  • 用户筛选:
    from:acairns.co.uk
    或使用
    author=
    参数
  • 日期筛选:
    since:2025-01-01
    或使用
    since=
    参数
  • 话题标签、提及、域名链接:
    #python mentions:user domain:github.com
可结合查询语法与函数参数进行复杂搜索。

Monitor a User

监控用户

  1. Fetch profile with
    get_profile(handle)
    for context (bio, follower count, post count)
  2. Get recent posts with
    get_user_posts(handle, limit=N)
  3. For topic-specific user content, use
    search_posts(query, author=handle)
  1. 使用
    get_profile(handle)
    获取用户资料上下文(简介、粉丝数、帖子数)
  2. 使用
    get_user_posts(handle, limit=N)
    获取用户近期帖子
  3. 若要获取用户特定话题的内容,使用
    search_posts(query, author=handle)

Discover What's Trending

发现热门内容

Recommended workflow — trending API first, firehose for deep dives:
推荐工作流:先使用热门话题API快速扫描,再用firehose进行深度探索:

1. Quick scan with trending topics (~500 tokens)

1. 快速扫描热门话题(约500个token)

python
topics = get_trending_topics(limit=10)
python
topics = get_trending_topics(limit=10)

Returns: {topics: [{topic, display_name, description, link}, ...],

返回结果:{topics: [{topic, display_name, description, link}, ...],

suggested: [...]}

suggested: [...]}

undefined
undefined

2. Rich trends with post counts and actors

2. 获取包含帖子数和参与用户的详细热门趋势

python
trends = get_trending(limit=10)
for t in trends:
    print(f"{t['display_name']} — {t['post_count']} posts ({t['status']})")
python
trends = get_trending(limit=10)
for t in trends:
    print(f"{t['display_name']} — {t['post_count']} posts ({t['status']})")

Each trend includes: topic, display_name, link, started_at,

每个趋势包含:topic、display_name、link、started_at、

post_count, status, category, actors

post_count、status、category、actors

undefined
undefined

3. Targeted exploration of selected trends

3. 针对性探索选定的热门话题

python
posts = search_posts(trend["topic"], limit=25)
python
posts = search_posts(trend["topic"], limit=25)

4. Optional: Firehose for velocity monitoring or long-tail discovery

4. 可选:使用Firehose进行热度监控或长尾内容发现

Prerequisites: Install Node.js dependencies once per session:
bash
cd /home/claude && npm install ws https-proxy-agent 2>/dev/null
python
data = sample_firehose(duration=30)  # Full firehose sample
data = sample_firehose(duration=20, filter="python")  # Filtered sample
Returns:
topWords
,
topPhrases
,
entities
,
samplePosts
,
stats
前置条件:每个会话需安装一次Node.js依赖:
bash
cd /home/claude && npm install ws https-proxy-agent 2>/dev/null
python
data = sample_firehose(duration=30)  # 完整数据流采样
data = sample_firehose(duration=20, filter="python")  # 筛选后的采样
返回结果包含:
topWords
、
topPhrases
、
entities
、
samplePosts
、
stats

Read Feeds and Lists

读取订阅源和列表

get_feed_posts()
accepts:
  • List URLs:
    https://bsky.app/profile/austegard.com/lists/3lankcdrlip2f
  • Feed URLs:
    https://bsky.app/profile/did:plc:xxx/feed/feedname
  • AT-URIs:
    at://did:plc:xxx/app.bsky.graph.list/xyz
The function extracts the AT-URI from URLs automatically.
get_feed_posts()
支持传入:
  • 列表URL:
    https://bsky.app/profile/austegard.com/lists/3lankcdrlip2f
  • 订阅源URL:
    https://bsky.app/profile/did:plc:xxx/feed/feedname
  • AT-URI:
    at://did:plc:xxx/app.bsky.graph.list/xyz
该函数会自动从URL中提取AT-URI。

Explore a Thread

探索帖子线程

Fetch full thread context for a post with parents and replies:
python
thread = get_thread("https://bsky.app/profile/user/post/xyz", depth=10)
获取某篇帖子的完整线程上下文,包括父帖和回复:
python
thread = get_thread("https://bsky.app/profile/user/post/xyz", depth=10)

Returns: {post: {...}, parent: {...}, replies: [...]}

返回结果:{post: {...}, parent: {...}, replies: [...]}

undefined
undefined

Find Quote Posts

查找引用帖子

Discover posts that quote a specific post:
python
quotes = get_quotes("https://bsky.app/profile/user/post/xyz")
for q in quotes:
    print(f"@{q['author_handle']}: {q['text'][:80]}")
发现引用特定帖子的内容:
python
quotes = get_quotes("https://bsky.app/profile/user/post/xyz")
for q in quotes:
    print(f"@{q['author_handle']}: {q['text'][:80]}")

Analyze Engagement

分析互动数据

Get users who engaged with a post:
python
likes = get_likes(post_url)
reposts = get_reposts(post_url)
获取与某篇帖子互动的用户:
python
likes = get_likes(post_url)
reposts = get_reposts(post_url)

Accepts both URLs and AT-URIs

同时支持URL和AT-URI

likes = get_likes("at://did:plc:.../app.bsky.feed.post/...")
undefined
likes = get_likes("at://did:plc:.../app.bsky.feed.post/...")
undefined

Explore Social Graph

探索社交关系图

Navigate follower/following relationships:
python
followers = get_followers("handle.bsky.social")
following = get_following("handle.bsky.social")
浏览粉丝/关注关系:
python
followers = get_followers("handle.bsky.social")
following = get_following("handle.bsky.social")

Returns list of actor dicts with handle, display_name, did, description, etc.

返回包含handle、display_name、did、description等字段的用户字典列表

undefined
undefined

Find Users

查找用户

Search for users by name, handle, or bio:
python
users = search_users("machine learning researcher")
for u in users:
    print(f"{u['display_name']} (@{u['handle']}): {u['description'][:100]}")
按名称、handle或简介搜索用户:
python
users = search_users("machine learning researcher")
for u in users:
    print(f"{u['display_name']} (@{u['handle']}): {u['description'][:100]}")

API Endpoint Notes

API端点说明

  • Public AppView:
    https://api.bsky.app/xrpc/
    for unauthenticated reads
  • PDS:
    https://bsky.social/xrpc/
    for authenticated requests
  • Trending:
    app.bsky.unspecced.getTrends
    (rich) and
    app.bsky.unspecced.getTrendingTopics
    (lightweight)
  • Firehose:
    wss://jetstream1.us-east.bsky.network/subscribe
  • Endpoint routing is automatic - authenticated requests go to PDS, public requests go to AppView
  • Rate limits exist but are generous for read operations
  • 公开AppView:
    https://api.bsky.app/xrpc/
    用于未验证的读取请求
  • PDS:
    https://bsky.social/xrpc/
    用于已验证的请求
  • 热门话题:
    app.bsky.unspecced.getTrends
    (详细版)和
    app.bsky.unspecced.getTrendingTopics
    (轻量版)
  • Firehose:
    wss://jetstream1.us-east.bsky.network/subscribe
  • 端点路由自动处理:已验证请求会发送到PDS,公开请求发送到AppView
  • 速率限制:存在速率限制,但读取操作的限制较为宽松

Return Format

返回格式

All API functions return structured dicts with:
  • uri
    : AT protocol identifier
  • text
    : Post content
  • created_at
    : ISO timestamp
  • author_handle
    : User handle
  • author_name
    : Display name
  • likes
    ,
    reposts
    ,
    replies
    : Engagement counts
  • links
    : Full URLs extracted from post facets (post text truncates URLs with "...")
  • image_alts
    : Alt text from embedded images
  • url
    : Direct link to post on bsky.app
Profile function returns:
handle
,
display_name
,
description
,
followers
,
following
,
posts
,
did
所有API函数均返回结构化字典,包含:
  • uri
    :AT协议标识符
  • text
    :帖子内容
  • created_at
    :ISO时间戳
  • author_handle
    :用户handle
  • author_name
    :显示名称
  • likes
    、
    reposts
    、
    replies
    :互动计数
  • links
    :从帖子 facets 中提取的完整URL(帖子文本中URL会被截断为“...”)
  • image_alts
    :嵌入图片的替代文本
  • url
    :bsky.app上的帖子直接链接
资料函数返回字段:
handle
、
display_name
、
description
、
followers
、
following
、
posts
、
did

Account Analysis

账户分析

Analyze accounts for categorization by topic. Fetches profile and posts, extracts keywords, and returns structured data for Claude to categorize.
通过分析账户进行话题分类。获取用户资料和帖子,提取关键词,返回结构化数据供Claude进行分类。

Analyze a User's Network

分析用户的社交网络

python
undefined
python
undefined

Analyze accounts you follow

分析你关注的账户

results = analyze_accounts(following="yourhandle.bsky.social", limit=50)
results = analyze_accounts(following="yourhandle.bsky.social", limit=50)

Analyze your followers

分析你的粉丝

results = analyze_accounts(followers="yourhandle.bsky.social", limit=50)
results = analyze_accounts(followers="yourhandle.bsky.social", limit=50)

Analyze specific handles

分析特定handle的账户

results = analyze_accounts(handles=["user1.bsky.social", "user2.bsky.social"])
undefined
results = analyze_accounts(handles=["user1.bsky.social", "user2.bsky.social"])
undefined

Single Account Analysis

单个账户分析

python
analysis = analyze_account("user.bsky.social")
python
analysis = analyze_account("user.bsky.social")

Returns: {handle, display_name, description, keywords, post_count, followers, following}

返回结果:{handle, display_name, description, keywords, post_count, followers, following}

undefined
undefined

Keyword Extraction Options

关键词提取选项

Stopwords parameter filters domain-specific noise:
  • "en"
    : English (general purpose, default)
  • "ai"
    : AI/ML domain (filters tech boilerplate)
  • "ls"
    : Life Sciences (filters research methodology)
python
results = analyze_accounts(following="handle", stopwords="ai")
Requires:
extracting-keywords
skill with YAKE venv for keyword extraction.
停用词参数可过滤特定领域的干扰词:
  • "en"
    :英文(通用,默认值)
  • "ai"
    :AI/ML领域(过滤技术套话)
  • "ls"
    :生命科学领域(过滤研究方法相关内容)
python
results = analyze_accounts(following="handle", stopwords="ai")
依赖要求:需要
extracting-keywords
技能及YAKE虚拟环境以实现关键词提取。

Filtering Accounts

过滤账户

python
results = analyze_accounts(
    following="handle",
    exclude_patterns=["bot", "spam", "promo"]  # Skip accounts matching these
)
python
results = analyze_accounts(
    following="handle",
    exclude_patterns=["bot", "spam", "promo"]  # 跳过匹配这些关键词的账户
)

Paginated Following/Followers

分页获取关注/粉丝列表

For large account lists beyond the 100 limit of
get_following
/
get_followers
:
python
all_following = get_all_following("handle", limit=500)  # Handles pagination
all_followers = get_all_followers("handle", limit=500)
对于超过
get_following
/
get_followers
100条限制的大型账户列表:
python
all_following = get_all_following("handle", limit=500)  # 处理分页
all_followers = get_all_followers("handle", limit=500)

Account Analysis Output

账户分析输出

Each analyzed account returns:
python
{
    "handle": "user.bsky.social",
    "display_name": "User Name",
    "description": "Bio text here",
    "keywords": ["keyword1", "keyword2", "keyword3"],
    "post_count": 20,
    "followers": 1234,
    "following": 567
}
Claude uses bio + keywords to categorize accounts by topic without hardcoded rules
每个被分析的账户返回结果如下:
python
{
    "handle": "user.bsky.social",
    "display_name": "User Name",
    "description": "Bio text here",
    "keywords": ["keyword1", "keyword2", "keyword3"],
    "post_count": 20,
    "followers": 1234,
    "following": 567
}
Claude会结合简介和关键词对账户进行话题分类,无需硬编码规则。