diff --git a/docs/programming.md b/docs/programming.md index 254a463c2..1e1be9d58 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -516,6 +516,14 @@ GitHub 官方也提供了一些 RSS: +### 微信开放社区-小游戏问答 + + + +| 全部 | 游戏引擎 | 规则 | 账号 | 运营 | 游戏审核 | API 和组件 | 框架 | 管理后台 | 开发者工具 | 客户端 | 插件 | 云开发 | 教程反馈 | 其他 | +| ---- | -------- | ---- | ----- | ---- | -------- | ---------- | ---- | -------- | ---------- | ------ | ---- | ------ | -------- | ---- | +| 0 | 4096 | 8192 | 16384 | 2048 | 1 | 2 | 64 | 4 | 8 | 16 | 256 | 1024 | 128 | 32 | + ### 微信开放社区-小程序问答 diff --git a/lib/router.js b/lib/router.js index 3ab705ee1..ced726245 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1648,13 +1648,14 @@ router.get('/wechat-open/community/xcx-announce', require('./routes/wechat-open/ router.get('/wechat-open/community/xyx-announce', require('./routes/wechat-open/community/xyx-announce')); router.get('/wechat-open/community/pay-announce', require('./routes/wechat-open/community/pay-announce')); router.get('/wechat-open/pay/announce', require('./routes/wechat-open/pay/announce')); +router.get('/wechat-open/community/xyx-question/:category', require('./routes/wechat-open/community/xyx-question')); router.get('/wechat-open/community/xcx-question/:tag', require('./routes/wechat-open/community/xcx-question')); + // 微店 router.get('/weidian/goods/:id', require('./routes/weidian/goods')); // 有赞 router.get('/youzan/goods/:id', require('./routes/youzan/goods')); - // 币世界快讯 router.get('/bishijie/kuaixun', require('./routes/bishijie/kuaixun')); diff --git a/lib/routes/wechat-open/community/xyx-question.js b/lib/routes/wechat-open/community/xyx-question.js new file mode 100644 index 000000000..be9d615df --- /dev/null +++ b/lib/routes/wechat-open/community/xyx-question.js @@ -0,0 +1,35 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const category = ctx.params.category; + + const response = await got({ + method: 'get', + url: `https://developers.weixin.qq.com/community/ngi/timeline/2/1/${category}?page=1&limit=10`, + headers: { + Referer: `https://developers.weixin.qq.com/community/minigame/question?type=${category}`, + }, + }); + + const data = response.data.data; + + ctx.state.data = { + // 源标题 + title: `微信开放社区的小程序问题 - ${category}`, + // 源链接 + link: `https://developers.weixin.qq.com/community/develop/question?tag=${category}`, + // 源说明 + description: `微信开放社区的小程序问题 - ${category}`, + // 遍历此前获取的数据 + item: data.rows.map((item) => ({ + // 文章标题 + title: item.Title, + // 文章正文 + description: `${item.Content}`, + // 文章发布时间 + pubDate: new Date(item.CreateTime * 1000).toUTCString(), + // 文章链接 + link: `https://developers.weixin.qq.com/community/develop/doc/${item.DocId}`, + })), + }; +};