← 返回 Skills 市场
275
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install chinese-joke-api
功能描述
Fetches humorous Chinese jokes using third-party APIs like Hitokoto and JokeAPI with error handling and timeout support.
使用说明 (SKILL.md)
Chinese Joke API Skill
概述
这个 skill 使用第三方中文笑话 API 获取有趣的中式幽默。
API 源
1. 一言 API (Hitokoto)
特点: 包含各种类型的中文短句,包括笑话
基础 URL: https://v1.hitokoto.cn
用法:
curl "https://v1.hitokoto.cn?c=j"
参数:
c=j- 搞笑类别c=a- 动画c=b- 漫画c=c- 原创
2. 简短笑话 API
特点: 专门的笑话 API,返回中文短笑话
基础 URL: https://api.jokeapi.cn
用法:
curl "https://api.jokeapi.cn/joke/Any?safe-mode"
快速开始
使用 Bash
# 获取一言搞笑
curl -s "https://v1.hitokoto.cn?c=j" | python3 -m json.tool
# 获取简短笑话
curl -s "https://api.jokeapi.cn/joke/Any?safe-mode" | python3 -m json.tool
使用 Python
import requests
# 一言搞笑
resp = requests.get("https://v1.hitokoto.cn?c=j")
data = resp.json()
print(f"{data['hitokoto']} - {data['from']}")
# 简短笑话
resp = requests.get("https://api.jokeapi.cn/joke/Any?safe-mode")
data = resp.json()
if data['type'] == 'single':
print(data['joke'])
else:
print(data['setup'])
print(data['delivery'])
示例代码
Bash 脚本
#!/bin/bash
# 获取一言搞笑
curl -s "https://v1.hitokoto.cn?c=j" | python3 -c "
import sys, json
d = json.load(sys.stdin)
print(f'「{d['hitokoto']}」')
print(f'—— {d.get('from_') or d.get('from')}')
"
Python 脚本
#!/usr/bin/env python3
import requests
import json
def get_chinese_joke():
"""获取中文笑话"""
try:
# 尝试一言 API
resp = requests.get("https://v1.hitokoto.cn?c=j", timeout=5)
data = resp.json()
print(f"「{data['hitokoto']}」")
print(f"—— {data.get('from_', data.get('from'))}")
return True
except Exception as e:
print(f"获取失败:{e}")
return False
if __name__ == "__main__":
get_chinese_joke()
注意事项
⚠️ 这些 API 都是第三方服务,可用性可能不稳定:
- 一言 API:偶尔响应慢
- 简短笑话 API:可能有时限流
建议:
- 添加错误处理
- 设置超时
- 考虑备用 API
相关链接
安全使用建议
This skill appears coherent and low-risk: it calls public joke APIs and parses the JSON locally, requires no credentials, and includes a small bash helper. Before installing, ensure you are comfortable with the skill making outbound HTTP requests from your environment (network access required). Review the provided script if you run it locally (the SKILL.md has a quoting error in one example but the included script is correct). If you care about privacy or rate limits, note that requests go to third-party endpoints (Hitokoto and jokeapi.cn) and those services will see the request metadata; no user secrets are sent by the skill.
功能分析
Type: OpenClaw Skill
Name: chinese-joke-api
Version: 1.0.0
The skill is a straightforward implementation for fetching jokes from public APIs (v1.hitokoto.cn and api.jokeapi.cn). The code in SKILL.md and scripts/chinese-joke.sh performs standard HTTP GET requests and JSON parsing without any signs of data exfiltration, malicious execution, or prompt injection.
能力评估
Purpose & Capability
Name/description match the included SKILL.md and scripts: both use Hitokoto and JokeAPI endpoints to fetch jokes. No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
Instructions only describe network requests to the stated third-party APIs and local parsing with Python; they do not read unrelated files, request credentials, or send data to unexpected endpoints. (Note: the SKILL.md contains a quoting mistake in one Bash example that would break if copied verbatim; the shipped script is correctly quoted.)
Install Mechanism
No install spec — instruction-only with a small included bash script; nothing is downloaded from external or untrusted URLs and nothing is written to disk beyond the provided script.
Credentials
No environment variables, secrets, or external credentials are requested or needed; the APIs used are public and the script sets a reasonable curl timeout.
Persistence & Privilege
The skill does not request persistent/always-on privileges, does not modify other skills or system settings, and is user-invocable by default.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install chinese-joke-api - 安装完成后,直接呼叫该 Skill 的名称或使用
/chinese-joke-api触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the Chinese Joke API skill.
- Integrates two third-party APIs: Hitokoto (一言) for various types of Chinese short phrases including jokes, and jokeapi.cn for short Chinese jokes.
- Provides easy usage instructions and example code in both Bash and Python.
- Includes recommendations for error handling and notes about third-party API availability.
元数据
常见问题
Chinese Joke Api 是什么?
Fetches humorous Chinese jokes using third-party APIs like Hitokoto and JokeAPI with error handling and timeout support. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 275 次。
如何安装 Chinese Joke Api?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install chinese-joke-api」即可一键安装,无需额外配置。
Chinese Joke Api 是免费的吗?
是的,Chinese Joke Api 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Chinese Joke Api 支持哪些平台?
Chinese Joke Api 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Chinese Joke Api?
由 Djttt(@djttt)开发并维护,当前版本 v1.0.0。
推荐 Skills