mastodon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMastodon Skill
Mastodon Skill
Overview
概述
Automates Mastodon operations including creating toots, boosting content, managing follows, and engaging with the fediverse through browser automation.
通过浏览器自动化实现Mastodon操作自动化,包括创建帖子、转发内容、管理关注以及与联邦宇宙进行互动。
Quick Install
快速安装
bash
curl -sSL https://canifi.com/skills/mastodon/install.sh | bashOr manually:
bash
cp -r skills/mastodon ~/.canifi/skills/bash
curl -sSL https://canifi.com/skills/mastodon/install.sh | bash或手动安装:
bash
cp -r skills/mastodon ~/.canifi/skills/Setup
配置
Configure via canifi-env:
bash
undefined通过canifi-env进行配置:
bash
undefinedFirst, ensure canifi-env is installed:
首先,确保已安装canifi-env:
curl -sSL https://canifi.com/install.sh | bash
curl -sSL https://canifi.com/install.sh | bash
canifi-env set MASTODON_INSTANCE "mastodon.social"
canifi-env set MASTODON_EMAIL "your-email@example.com"
canifi-env set MASTODON_PASSWORD "your-password"
undefinedcanifi-env set MASTODON_INSTANCE "mastodon.social"
canifi-env set MASTODON_EMAIL "your-email@example.com"
canifi-env set MASTODON_PASSWORD "your-password"
undefinedPrivacy & Authentication
隐私与认证
Your credentials, your choice. Canifi LifeOS respects your privacy.
你的凭据,由你掌控。 Canifi LifeOS尊重你的隐私。
Option 1: Manual Browser Login (Recommended)
选项1:手动浏览器登录(推荐)
If you prefer not to share credentials with Claude Code:
- Complete the Browser Automation Setup using CDP mode
- Login to the service manually in the Playwright-controlled Chrome window
- Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
- 使用CDP模式完成浏览器自动化配置
- 在Playwright控制的Chrome窗口中手动登录该服务
- Claude将使用你的已认证会话,且永远不会看到你的密码
Option 2: Environment Variables
选项2:环境变量
If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果你愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"注意:存储在canifi-env中的凭据仅能在你的本地机器上访问,绝不会被传输。
Capabilities
功能
- Create and publish toots
- Boost and favorite posts
- Reply to toots
- Follow/unfollow accounts
- Search users and hashtags
- Manage lists
- View local and federated timelines
- Handle content warnings
- 创建并发布帖子
- 转发和收藏帖子
- 回复帖子
- 关注/取消关注账号
- 搜索用户和话题标签
- 管理列表
- 查看本地和联邦时间线
- 处理内容警告
Usage Examples
使用示例
Example 1: Create a Toot
示例1:创建帖子
User: "Post to Mastodon about the open source project"
Claude: I'll create that toot.
- Navigate to Mastodon instance
- Click compose
- Write post about project
- Add relevant hashtags
- Publish toot用户:“在Mastodon上发布关于这个开源项目的内容”
Claude:我来创建这个帖子。
- 导航至Mastodon实例
- 点击撰写按钮
- 撰写关于该项目的帖子
- 添加相关话题标签
- 发布帖子Example 2: Boost Content
示例2:转发内容
User: "Boost that interesting toot about federated networks"
Claude: I'll boost that toot.
- Find the original toot
- Click boost button
- Confirm boosted
- Verify in your profile用户:“转发那条关于联邦网络的有趣帖子”
Claude:我来转发这个帖子。
- 找到原帖子
- 点击转发按钮
- 确认转发完成
- 在你的个人资料中验证Example 3: Search Hashtags
示例3:搜索话题标签
User: "Find posts tagged #opensource on Mastodon"
Claude: I'll search that hashtag.
- Navigate to search
- Search #opensource
- Browse results
- Present interesting toots用户:“在Mastodon上查找带有#opensource标签的帖子”
Claude:我来搜索这个话题标签。
- 导航至搜索页面
- 搜索#opensource
- 浏览结果
- 展示有趣的帖子Example 4: View Federated Timeline
示例4:查看联邦时间线
User: "Show me what's happening on the federated timeline"
Claude: I'll check the federated feed.
- Navigate to federated timeline
- Browse recent posts
- Summarize trending topics
- Note interesting accounts用户:“让我看看联邦时间线的动态”
Claude:我来查看联邦信息流。
- 导航至联邦时间线
- 浏览最新帖子
- 总结热门话题
- 标记有趣的账号Authentication Flow
认证流程
- Navigate to instance URL via Playwright MCP
- Enter email and password from canifi-env
- Handle 2FA if enabled (notify user via iMessage)
- Verify home timeline access
- Maintain session cookies
- 通过Playwright MCP导航至实例URL
- 从canifi-env中读取邮箱和密码
- 如果启用了双因素认证(2FA),通过iMessage通知用户
- 验证主页时间线访问权限
- 维护会话Cookie
Error Handling
错误处理
- Login Failed: Verify instance and credentials
- Session Expired: Re-authenticate automatically
- 2FA Required: iMessage for verification code
- Instance Down: Try later or notify user
- Federation Issue: Some content may not be available
- Rate Limited: Implement backoff
- User Not Found: Check instance and username format
- Content Warning Required: Add CW if needed
- 登录失败:验证实例地址和凭据
- 会话过期:自动重新认证
- 需要2FA:通过iMessage请求验证码
- 实例宕机:稍后重试或通知用户
- 联邦问题:部分内容可能无法访问
- 速率限制:实现退避机制
- 用户未找到:检查实例和用户名格式
- 需要内容警告:按需添加内容警告(CW)
Self-Improvement Instructions
自我改进说明
When encountering new Mastodon features:
- Document instance-specific UI elements
- Add support for new post types
- Log successful federation patterns
- Update for Mastodon updates
当遇到Mastodon新功能时:
- 记录实例特定的UI元素
- 添加对新帖子类型的支持
- 记录成功的联邦模式
- 针对Mastodon更新进行适配
Notes
注意事项
- Different instances have different rules
- Username format: @user@instance
- Content warnings are cultural norm
- Local timeline shows same-instance posts
- Federated timeline shows connected instances
- Some instances are invite-only
- Alt text encouraged for images
- 不同实例有不同的规则
- 用户名格式:@用户@实例
- 内容警告是文化惯例
- 本地时间线显示同一实例的帖子
- 联邦时间线显示已连接实例的帖子
- 部分实例需要邀请才能加入
- 图片建议添加替代文本(Alt text)