CodeChat 是一款专为编程猫社区打造的聊天增强扩展。 实时私聊、发送图片、提及好友、消息撤回、已读回执—— 社区沟通本该如此。
点对点即时消息,不受限于评论区,支持在线及离线用户发起会话
粘贴截图或上传图片,Ctrl+V 极速分享,大小不超过 5MB
两分钟内可撤回已发消息,手滑也不怕
@ 好友高亮提醒,消息已读状态一目了然
下载 ZIP 包,解压后即可看到 codemao-extension.crx 和源码文件夹。
方式一:拖拽安装(推荐)
下载 ZIP 并解压。
Chrome 打开 chrome://extensions,开启右上角 「开发者模式」。
将解压后的 codemao-extension.crx 拖入页面即可。
方式二:加载源码文件夹
下载 ZIP 并解压到任意文件夹。
Chrome 打开 chrome://extensions,开启 「开发者模式」。
点击 「加载已解压的扩展程序」,选择解压后的 codemao-extension 文件夹。
// 示例:获取用户 1198872864
fetch('https://api.codemao.cn/web/users/details/1198872864')
.then(r => r.json())
.then(data => {
console.log(data.nickname); // "取昵称咋这么难"
console.log(data.avatar_url); // 头像 URL
});
fetch('https://api.codemao.cn/web/users/current', {
credentials: 'include'
})
.then(r => r.json())
.then(data => {
console.log('登录用户:', data.nickname);
});
fetch('https://api.codemao.cn/api/user/info', {
credentials: 'include'
})
.then(r => r.json())
.then(data => {
console.log(data.nickname, data.avatar);
});
fetch('https://shequ.codemao.cn/api/community/1651308/posts')
.then(r => r.json())
.then(posts => {
posts.forEach(p => console.log(p.title));
});
fetch('https://api.codemao.cn/web/comments', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: '评论内容',
type: 'work',
targetId: 123456
})
});
| 用户 | 昵称 | IP | 时间 |
|---|
暂无数据