这个技能做什么
这个技能提供一个命令行接口,用于从官方 API 获取 DAO3(神岛)平台数据。
覆盖两类能力:
- - 公开接口(无需认证)
- 认证接口(需要 token + user-agent)
所有命令都会向 stdout 输出一个 JSON 对象。
如何运行
在 scripts/ 目录下运行:
CODEBLOCK0
命令
公开接口(无需认证)
user-profile --user-id <id>
用途:通过用户 ID 获取用户个人资料。
参数:
map-info --map-id <id>
用途:通过地图/内容 ID 获取地图详情。
参数:
- -
--map-id <id>:地图(content)ID。
map-comments --content-id <id> --limit <n> --offset <n> --order-by <n> --content-type <n>
用途:获取地图/模型的评论列表。
参数:
- -
--content-id <id>:内容 ID(地图/模型 ID)。 - INLINECODE7 :返回数量(上游通常限制最大 100)。
- INLINECODE8 :偏移量(分页用)。
- INLINECODE9 :排序方式(例如 1=创建时间倒序;4=热度等,具体以接口为准)。
- INLINECODE10 :内容类型(例如 1=地图;2=模型)。
map-release --content-id <id> --limit <n> --offset <n>
用途:获取地图发布信息。
参数:
- -
--content-id <id>:地图 ID。 - INLINECODE13 :返回数量。
- INLINECODE14 :偏移量。
user-maps --user-id <id> --limit <n> --offset <n>
用途:获取某个用户发布/关联的地图列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE17 :返回数量。
- INLINECODE18 :偏移量。
user-models --user-id <id> --limit <n> --offset <n>
用途:获取某个用户的模型列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE21 :返回数量。
- INLINECODE22 :偏移量。
user-favorites --user-id <id> --limit <n> --offset <n> --content-type <n>
用途:获取某个用户的收藏列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE25 :返回数量。
- INLINECODE26 :偏移量。
- INLINECODE27 :收藏内容类型(例如 1=地图;2=模型)。
user-recent --user-id <id> --limit <n> --offset <n>
用途:获取某个用户最近游玩列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE30 :返回数量。
- INLINECODE31 :偏移量。
user-followers --user-id <id> --limit <n> --offset <n>
用途:获取某个用户的粉丝列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE34 :返回数量。
- INLINECODE35 :偏移量。
user-friends --user-id <id> --limit <n> --offset <n>
用途:获取某个用户的好友列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE38 :返回数量。
- INLINECODE39 :偏移量。
user-following --user-id <id> --limit <n> --offset <n>
用途:获取某个用户的关注列表。
参数:
- -
--user-id <id>:用户 ID。 - INLINECODE42 :返回数量。
- INLINECODE43 :偏移量。
search --keyword <kw> --limit <n> --offset <n> --order-by <n>
用途:通过关键字搜索地图/模型列表。
参数:
- -
--keyword <kw>:关键词。 - INLINECODE46 :返回数量。
- INLINECODE47 :偏移量。
- INLINECODE48 :排序方式(例如 0=推荐/最热;1=最新;具体以接口为准)。
示例:
CODEBLOCK1
认证接口(token + user-agent)
必须同时提供:
- -
--token: DAO3 认证 token - INLINECODE50 : 类浏览器的 UA 字符串
命令:
msg-comments --offset <n> --limit <n> --token <t> --user-agent <ua>
用途:获取“评论消息”列表(站内消息/通知类)。
参数:
- -
--offset <n>:偏移量。 - INLINECODE53 :返回数量。
- INLINECODE54 :认证 token。
- INLINECODE55 :UA 字符串(会同时用于
user-agent 和 x-dao-ua 请求头)。
msg-likes --offset <n> --limit <n> --token <t> --user-agent <ua>
用途:获取“点赞消息”列表。
参数:同 msg-comments。
msg-sys --offset <n> --limit <n> --token <t> --user-agent <ua>
用途:获取“系统消息”列表。
参数:同 msg-comments。
stats-maps --start-time <YYYY-MM-DD> --end-time <YYYY-MM-DD> --token <t> --user-agent <ua>
用途:获取当前用户的地图统计列表(按日期范围)。
参数:
- -
--start-time <YYYY-MM-DD>:开始日期。 - INLINECODE64 :结束日期。
- INLINECODE65 :认证 token。
- INLINECODE66 :UA 字符串。
stats-player --start-time <YYYY-MM-DD> --end-time <YYYY-MM-DD> --map-id <id> --token <t> --user-agent <ua>
用途:获取指定地图的玩家统计数据(按日期范围)。
参数:
- -
--start-time <YYYY-MM-DD>:开始日期。 - INLINECODE69 :结束日期。
- INLINECODE70 :地图 ID。
- INLINECODE71 :认证 token。
- INLINECODE72 :UA 字符串。
stats-retention --start-time <YYYY-MM-DD> --end-time <YYYY-MM-DD> --map-id <id> --token <t> --user-agent <ua>
用途:获取指定地图的玩家留存数据(按日期范围)。
参数:同 stats-player。
stats-behavior --start-time <YYYY-MM-DD> --end-time <YYYY-MM-DD> --map-id <id> --token <t> --user-agent <ua>
用途:获取指定地图的玩家行为分析数据(按日期范围)。
参数:同 stats-player。
示例:
CODEBLOCK2
Raw 端点逃生口
如果你需要调用尚未映射为专用命令的端点:
用途:直接请求任意上游 API 端点(适合临时验证/调试/未映射的新端点)。
参数:
- -
--endpoint <path-or-query>:以 / 开头的端点路径(可带 querystring)。 - INLINECODE80 与
--user-agent <ua>:可选;如果该端点需要认证则必须同时提供。
示例:
CODEBLOCK3
输出
- - 成功:输出 API 的 JSON 响应
- 失败:输出包含
error、endpoint 的 JSON;并可能包含 status_code、 INLINECODE85
备注 / 边界情况
- -
--limit 的取值最大为100。 - 网络失败/超时会以错误 JSON 形式返回。
这个技能做什么
这个技能提供一个命令行接口,用于从官方 API 获取 DAO3(神岛)平台数据。
覆盖两类能力:
- - 公开接口(无需认证)
- 认证接口(需要 token + user-agent)
所有命令都会向 stdout 输出一个 JSON 对象。
如何运行
在 scripts/ 目录下运行:
bash
python3 -m dao3_statistics --help
命令
公开接口(无需认证)
user-profile --user-id
用途:通过用户 ID 获取用户个人资料。
参数:
map-info --map-id
用途:通过地图/内容 ID 获取地图详情。
参数:
- - --map-id :地图(content)ID。
map-comments --content-id --limit --offset --order-by --content-type
用途:获取地图/模型的评论列表。
参数:
- - --content-id :内容 ID(地图/模型 ID)。
- --limit :返回数量(上游通常限制最大 100)。
- --offset :偏移量(分页用)。
- --order-by :排序方式(例如 1=创建时间倒序;4=热度等,具体以接口为准)。
- --content-type :内容类型(例如 1=地图;2=模型)。
map-release --content-id --limit --offset
用途:获取地图发布信息。
参数:
- - --content-id :地图 ID。
- --limit :返回数量。
- --offset :偏移量。
user-maps --user-id --limit --offset
用途:获取某个用户发布/关联的地图列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
user-models --user-id --limit --offset
用途:获取某个用户的模型列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
user-favorites --user-id --limit --offset --content-type
用途:获取某个用户的收藏列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
- --content-type :收藏内容类型(例如 1=地图;2=模型)。
user-recent --user-id --limit --offset
用途:获取某个用户最近游玩列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
user-followers --user-id --limit --offset
用途:获取某个用户的粉丝列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
user-friends --user-id --limit --offset
用途:获取某个用户的好友列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
user-following --user-id --limit --offset
用途:获取某个用户的关注列表。
参数:
- - --user-id :用户 ID。
- --limit :返回数量。
- --offset :偏移量。
search --keyword --limit --offset --order-by
用途:通过关键字搜索地图/模型列表。
参数:
- - --keyword :关键词。
- --limit :返回数量。
- --offset :偏移量。
- --order-by :排序方式(例如 0=推荐/最热;1=最新;具体以接口为准)。
示例:
bash
python3 -m dao3_statistics user-profile --user-id 83354
python3 -m dao3_statistics map-info --map-id 100131463
python3 -m dao3_statistics search --keyword test --limit 10 --offset 0 --order-by 0
认证接口(token + user-agent)
必须同时提供:
- - --token: DAO3 认证 token
- --user-agent: 类浏览器的 UA 字符串
命令:
msg-comments --offset --limit --token --user-agent
用途:获取“评论消息”列表(站内消息/通知类)。
参数:
- - --offset :偏移量。
- --limit :返回数量。
- --token :认证 token。
- --user-agent :UA 字符串(会同时用于 user-agent 和 x-dao-ua 请求头)。
msg-likes --offset --limit --token --user-agent
用途:获取“点赞消息”列表。
参数:同 msg-comments。
msg-sys --offset --limit --token --user-agent
用途:获取“系统消息”列表。
参数:同 msg-comments。
stats-maps --start-time --end-time --token --user-agent
用途:获取当前用户的地图统计列表(按日期范围)。
参数:
- - --start-time :开始日期。
- --end-time :结束日期。
- --token :认证 token。
- --user-agent :UA 字符串。
stats-player --start-time --end-time --map-id --token --user-agent
用途:获取指定地图的玩家统计数据(按日期范围)。
参数:
- - --start-time :开始日期。
- --end-time :结束日期。
- --map-id :地图 ID。
- --token :认证 token。
- --user-agent :UA 字符串。
stats-retention --start-time --end-time --map-id --token --user-agent
用途:获取指定地图的玩家留存数据(按日期范围)。
参数:同 stats-player。
stats-behavior --start-time --end-time --map-id --token --user-agent
用途:获取指定地图的玩家行为分析数据(按日期范围)。
参数:同 stats-player。
示例:
bash
python3 -m dao3_statistics stats-player \
--start-time 2025-03-29 \
--end-time 2025-04-04 \
--map-id 100131463 \
--token YOUR_TOKEN \
--user-agent Mozilla/5.0 ...
Raw 端点逃生口
如果你需要调用尚未映射为专用命令的端点:
- - raw --endpoint [--token --user-agent ]
用途:直接请求任意上游 API 端点(适合临时验证/调试/未映射的新端点)。
参数:
- - --endpoint :以 / 开头的端点路径(可带 querystring)。
- --token 与 --user-agent :可选;如果该端点需要认证则必须同时提供。
示例:
bash
python3 -m dao3_statistics raw --endpoint /user/profile/83354
输出
- - 成功:输出 API 的 JSON 响应
- 失败:输出包含 error、endpoint 的 JSON;并可能包含 status_code、response
备注 / 边界情况
- - --limit 的取值最大为100。
- 网络失败/超时会以错误 JSON 形式返回。