browsing-bluesky
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBrowsing 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
设置步骤
- Create an app password at Bluesky: Settings → Privacy and Security → App Passwords
- Set environment variables:
bash
export BSKY_HANDLE="yourhandle.bsky.social" export BSKY_APP_PASSWORD="xxxx-xxxx-xxxx-xxxx"
- 在Bluesky创建应用密码:设置 → 隐私与安全 → 应用密码
- 设置环境变量:
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()
undefinedclear_session()
undefinedResearch Workflows
研究工作流
Investigate a Topic
研究特定话题
Use with query syntax matching bsky.app advanced search:
search_posts()- Basic terms:
event sourcing - Exact phrases:
"event sourcing" - User filter: or use
from:acairns.co.ukparamauthor= - Date filter: or use
since:2025-01-01paramsince= - Hashtags, mentions, domain links:
#python mentions:user domain:github.com
Combine query syntax with function params for complex searches.
使用函数,支持与bsky.app高级搜索匹配的查询语法:
search_posts()- 基础关键词:
event sourcing - 精确短语:
"event sourcing" - 用户筛选:或使用
from:acairns.co.uk参数author= - 日期筛选:或使用
since:2025-01-01参数since= - 话题标签、提及、域名链接:
#python mentions:user domain:github.com
可结合查询语法与函数参数进行复杂搜索。
Monitor a User
监控用户
- Fetch profile with for context (bio, follower count, post count)
get_profile(handle) - Get recent posts with
get_user_posts(handle, limit=N) - For topic-specific user content, use
search_posts(query, author=handle)
- 使用获取用户资料上下文(简介、粉丝数、帖子数)
get_profile(handle) - 使用获取用户近期帖子
get_user_posts(handle, limit=N) - 若要获取用户特定话题的内容,使用
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: [...]}
undefinedundefined2. 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
undefinedundefined3. 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/nullpython
data = sample_firehose(duration=30) # Full firehose sample
data = sample_firehose(duration=20, filter="python") # Filtered sampleReturns: , , , ,
topWordstopPhrasesentitiessamplePostsstats前置条件:每个会话需安装一次Node.js依赖:
bash
cd /home/claude && npm install ws https-proxy-agent 2>/dev/nullpython
data = sample_firehose(duration=30) # 完整数据流采样
data = sample_firehose(duration=20, filter="python") # 筛选后的采样返回结果包含:、、、、
topWordstopPhrasesentitiessamplePostsstatsRead Feeds and Lists
读取订阅源和列表
get_feed_posts()- 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: [...]}
undefinedundefinedFind 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/...")
undefinedlikes = get_likes("at://did:plc:.../app.bsky.feed.post/...")
undefinedExplore 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等字段的用户字典列表
undefinedundefinedFind 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: for unauthenticated reads
https://api.bsky.app/xrpc/ - PDS: for authenticated requests
https://bsky.social/xrpc/ - Trending: (rich) and
app.bsky.unspecced.getTrends(lightweight)app.bsky.unspecced.getTrendingTopics - 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:
- : AT protocol identifier
uri - : Post content
text - : ISO timestamp
created_at - : User handle
author_handle - : Display name
author_name - ,
likes,reposts: Engagement countsreplies - : Full URLs extracted from post facets (post text truncates URLs with "...")
links - : Alt text from embedded images
image_alts - : Direct link to post on bsky.app
url
Profile function returns: , , , , , ,
handledisplay_namedescriptionfollowersfollowingpostsdid所有API函数均返回结构化字典,包含:
- :AT协议标识符
uri - :帖子内容
text - :ISO时间戳
created_at - :用户handle
author_handle - :显示名称
author_name - 、
likes、reposts:互动计数replies - :从帖子 facets 中提取的完整URL(帖子文本中URL会被截断为“...”)
links - :嵌入图片的替代文本
image_alts - :bsky.app上的帖子直接链接
url
资料函数返回字段:、、、、、、
handledisplay_namedescriptionfollowersfollowingpostsdidAccount 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
undefinedpython
undefinedAnalyze 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"])
undefinedresults = analyze_accounts(handles=["user1.bsky.social", "user2.bsky.social"])
undefinedSingle 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}
undefinedundefinedKeyword Extraction Options
关键词提取选项
Stopwords parameter filters domain-specific noise:
- : English (general purpose, default)
"en" - : AI/ML domain (filters tech boilerplate)
"ai" - : Life Sciences (filters research methodology)
"ls"
python
results = analyze_accounts(following="handle", stopwords="ai")Requires: skill with YAKE venv for keyword extraction.
extracting-keywords停用词参数可过滤特定领域的干扰词:
- :英文(通用,默认值)
"en" - :AI/ML领域(过滤技术套话)
"ai" - :生命科学领域(过滤研究方法相关内容)
"ls"
python
results = analyze_accounts(following="handle", stopwords="ai")依赖要求:需要技能及YAKE虚拟环境以实现关键词提取。
extracting-keywordsFiltering 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_followingget_followerspython
all_following = get_all_following("handle", limit=500) # Handles pagination
all_followers = get_all_followers("handle", limit=500)对于超过/ 100条限制的大型账户列表:
get_followingget_followerspython
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会结合简介和关键词对账户进行话题分类,无需硬编码规则。