连接 LinuxDo 论坛的强大 Dify 插件
作者: frederick | 类型: 工具插件 | 版本: 0.0.2
English Documentation | 功能特性 | 快速开始 | API文档
LinuxDo Connect 插件让你能够在 Dify 中无缝连接和操作 LinuxDo 论坛
LinuxDo Connect 插件允许你在 Dify 中直接连接和操作 LinuxDo 论坛。通过 LinuxDo Connect API,你可以进行身份验证、获取用户信息、搜索内容、获取个性化推荐,以及执行自动签到等操作。
The LinuxDo Connect plugin allows you to directly connect and interact with the LinuxDo forum within Dify. Through the LinuxDo Connect API, you can perform authentication, retrieve user information, search content, get personalized recommendations, and execute automatic check-ins.
|
User Authentication & Information
|
Content Search
|
Get LinuxDo Connect API Credentials
访问 LinuxDo Connect 申请 API 访问权限
详细步骤 | Detailed Steps
访问: https://connect.linux.do
点击: "我的应用接入" -> "申请新接入"
填写: 应用信息和回调地址
| 凭据类型 | 用途 | Purpose |
|---|---|---|
| Client ID | 基础认证的客户端标识 | Client identifier for basic auth |
| Client Secret | 基础认证的客户端密钥 | Client secret for basic auth |
| API Key | 用户账户识别密钥 | API key for user account identification |
Configure Plugin in Dify
graph LR
A[安装插件] --> B[打开配置页面]
B --> C[填入凭据]
C --> D[保存配置]
D --> E[开始使用]
配置项 | Configuration Items:
- Client ID: 你的 LinuxDo Client ID
- Client Secret: 你的 LinuxDo Client Secret
- API Key: 你的 LinuxDo API Key
| 特性 | LinuxDo Connect | 传统方案 | 优势 |
|---|---|---|---|
| 响应速度 | 快速响应 | 较慢 | 优化性能 |
| 安全认证 | OAuth 2.0 | 基础认证 | 企业级安全 |
| 数据处理 | 结构化JSON | 原始HTML | 易于解析 |
| 错误恢复 | 自动重试 | 手动处理 | 更可靠 |
| 内存占用 | 轻量级 | 占用较多 | 资源优化 |
基于LinuxDo Connect API的高效集成方案
支持快速用户认证和内容检索
优化的网络请求处理机制
|
获取完整用户信息 user_info = linuxdo_user_info(
include_extra_info=True,
verify_only=False
) |
快速验证 API Key verification = linuxdo_user_info(
include_extra_info=False,
verify_only=True
) |
|
搜索所有内容 search_results = linuxdo_content_search(
search_query="Python编程",
search_type="all",
limit=20,
sort_by="relevance"
) |
仅搜索主题 topic_results = linuxdo_content_search(
search_query="机器学习",
search_type="topics",
category_filter="技术讨论",
limit=10,
sort_by="date"
) |
| 端点类型 | URL | 说明 |
|---|---|---|
| 授权端点 | https://connect.linux.do/oauth2/authorize |
OAuth2 授权 |
| Token 端点 | https://connect.linux.do/oauth2/token |
获取访问令牌 |
| 用户信息端点 | https://connect.linux.do/api/user |
获取用户详细信息 |
| 用户信息端点 (OAuth2) | https://connect.linux.do/oauth2/userinfo |
OAuth2 用户信息 |
用户字段详情 | User Field Details
| 字段 | 说明 | Field | Description |
|---|---|---|---|
id |
用户唯一标识(不可变) | id |
Unique user identifier (immutable) |
username |
论坛用户名 | username |
Forum username |
name |
论坛用户昵称(可变) | name |
Forum display name (mutable) |
avatar_template |
用户头像模板URL | avatar_template |
User avatar template URL |
active |
账号活跃状态 | active |
Account active status |
trust_level |
信任等级(0-4) | trust_level |
Trust level (0-4) |
silenced |
禁言状态 | silenced |
Silenced status |
external_ids |
外部ID关联信息 | external_ids |
External ID associations |
api_key |
API访问密钥 | api_key |
API access key |
{
"user_info": {
"user_id": "string",
"api_key_valid": true,
"username": "string",
"name": "string",
"trust_level": 0,
"active": true,
"admin": false,
"moderator": false,
"created_at": "2024-01-01T00:00:00Z",
"last_seen_at": "2024-01-01T00:00:00Z"
},
"verification_result": {
"status": "success",
"user_id": "string",
"api_key_valid": true,
"message": "string"
}
}{
"search_results": [
{
"id": "string",
"title": "string",
"content": "string",
"author": "string",
"category": "string",
"url": "string",
"created_at": "2024-01-01T00:00:00Z",
"views": 0,
"replies": 0,
"relevance_score": 0.95
}
],
"search_summary": {
"total_results": 0,
"search_query": "string",
"search_type": "string",
"processing_time": 0.5,
"filters_applied": ["string"]
}
}重要提示: 请务必遵循以下安全最佳实践
|
Protect Credentials
|
Network Security
|
Access Control
|
linuxdo/
├── manifest.yaml # 插件清单文件
├── requirements.txt # Python 依赖
├── main.py # 插件入口点
├── provider/
│ ├── linuxdo.py # 提供者实现
│ └── linuxdo.yaml # 提供者配置
├── tools/
│ ├── linuxdo.py # 用户信息工具
│ ├── linuxdo.yaml # 用户信息工具配置
│ ├── content_search.py # 内容搜索工具
│ └── content_search.yaml # 内容搜索工具配置
└── _assets/
├── icon.svg # 插件图标
└── icon-dark.svg # 深色模式图标
本插件遵循相应的开源许可证。使用前请确保遵守 LinuxDo 论坛的使用条款和 API 使用政策。
This plugin follows the corresponding open source license. Please ensure compliance with LinuxDo forum terms of use and API usage policies before use.
|
Report Issues |
Email Contact |
使用本插件需要有效的 LinuxDo 账户和 Connect API 访问权限
请确保遵守论坛使用规则和 API 使用限制
Using this plugin requires a valid LinuxDo account and Connect API access permissions
Please ensure compliance with forum usage rules and API usage restrictions
感谢以下组织和个人的支持:
| LinuxDo Community | Dify Platform | GitHub |
|---|
Made with love by frederick | Powered by Dify | Connect with LinuxDo