linuxdolisted
Install: claude install-skill codingSamss/all-my-ai-needs
# LINUX DO Skill (Read-Only)
通过本地 Python 脚本只读访问 LINUX DO(linux.do)论坛内容。使用 Discourse JSON API + Chrome Cookie 自动提取认证,可访问有信任等级限制的帖子。
## Prerequisites
1. Python3 可用。
2. macOS 系统(Chrome Cookie 自动提取依赖 Keychain + CommonCrypto)。
3. Chrome 已登录 linux.do(首次使用时系统会弹出 Keychain 授权对话框,请点击"允许")。
4. 如网络环境受限,建议配置代理:
- `HTTPS_PROXY=http://127.0.0.1:7897`
## Script Path
```
CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
SCRIPT="${CODEX_HOME}/skills/linuxdo/scripts/linuxdo.py"
```
## Cookie Authentication
脚本按优先级自动解析 Cookie 来源:
1. `--cookie "name=value; ..."` 命令行直传
2. `--cookie-file <path>` 或环境变量 `LINUXDO_COOKIE_FILE`
3. 环境变量 `LINUXDO_COOKIE`
4. Chrome Cookie 自动提取(macOS 默认,零配置)
5. 无认证(仅可访问公开内容)
手动回退(当 Chrome 提取失败时):
```bash
# 从浏览器 DevTools > Application > Cookies 复制 Cookie 字符串
python3 "$SCRIPT" --cookie "_t=xxx; _forum_session=yyy" latest --limit 5
```
## Commands
### 1. 查看登录身份
**Triggers:** "linuxdo 登录状态", "linuxdo whoami", "l站身份"
```bash
python3 "$SCRIPT" whoami
```
### 2. 查看最新帖子
**Triggers:** "linuxdo 最新帖子", "l站最新", "latest linuxdo"
```bash
python3 "$SCRIPT" latest --limit 20
```
可选参数:
- `--page <n>`:翻页(从 0 开始)
- `--chars <n>`:摘要最大字符(默认 140)
### 3. 查看热门帖子
**Triggers:** "linuxdo 热门", "l站热帖", "linuxdo top", "l站 trending"
```bash
python3 "$SCRIPT" top --period weekly
```
可选参数:
- `--period`:`daily` / `weekly` / `monthly` / `yearly` / `all`(默认 weekly)
- `--limit <n>`:输出条数(默认 20)
### 4. 搜索帖子
**Triggers:** "搜索 linuxdo", "linuxdo 搜索", "search linuxdo", "l站搜索"
```bash
python3 "$SCRIPT" search