mastodon

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Mastodon 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 | bash
Or 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
undefined

First, ensure canifi-env is installed:

首先,确保已安装canifi-env:

canifi-env set MASTODON_INSTANCE "mastodon.social" canifi-env set MASTODON_EMAIL "your-email@example.com" canifi-env set MASTODON_PASSWORD "your-password"
undefined
canifi-env set MASTODON_INSTANCE "mastodon.social" canifi-env set MASTODON_EMAIL "your-email@example.com" canifi-env set MASTODON_PASSWORD "your-password"
undefined

Privacy & 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:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果你不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化配置
  2. 在Playwright控制的Chrome窗口中手动登录该服务
  3. 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

认证流程

  1. Navigate to instance URL via Playwright MCP
  2. Enter email and password from canifi-env
  3. Handle 2FA if enabled (notify user via iMessage)
  4. Verify home timeline access
  5. Maintain session cookies
  1. 通过Playwright MCP导航至实例URL
  2. 从canifi-env中读取邮箱和密码
  3. 如果启用了双因素认证(2FA),通过iMessage通知用户
  4. 验证主页时间线访问权限
  5. 维护会话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:
  1. Document instance-specific UI elements
  2. Add support for new post types
  3. Log successful federation patterns
  4. Update for Mastodon updates
当遇到Mastodon新功能时:
  1. 记录实例特定的UI元素
  2. 添加对新帖子类型的支持
  3. 记录成功的联邦模式
  4. 针对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)