diff --git a/docs/README.md b/docs/README.md index 1031b3270b..30469db12c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -733,6 +733,8 @@ GitHub 官方也提供了一些 RSS: + + ### 技术头条 diff --git a/router.js b/router.js index e9a463b88b..c594e10fe1 100644 --- a/router.js +++ b/router.js @@ -691,6 +691,7 @@ router.get('/dwnews/rank/:type/:range', require('./routes/dwnews/rank')); // 知晓程序 router.get('/miniapp/article/:category', require('./routes/miniapp/article')); +router.get('/miniapp/store/newest', require('./routes/miniapp/store/newest')); // 后续 router.get('/houxu/:type/:id', require('./routes/houxu/houxu')); diff --git a/routes/miniapp/store/newest.js b/routes/miniapp/store/newest.js new file mode 100644 index 0000000000..e0eaab47c9 --- /dev/null +++ b/routes/miniapp/store/newest.js @@ -0,0 +1,36 @@ +const axios = require('../../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: 'https://minapp.com/api/v5/trochili/miniapp/?tag=&offset=0&limit=21', + }); + + const data = response.data.objects; + + ctx.state.data = { + title: '小程序商店-知晓程序', + link: 'https://minapp.com/miniapp/', + description: '知晓程序,让你更知微信小程序。我们提供微信小程序开发资讯,解读微信小程序开发文档,制作微信小程序开发教程。此外,我们还有国内第一家微信小程序商店/应用市场/应用商店。点击入驻,立刻畅游微信小程序的海洋。', + item: data.map((item) => { + const screenshots = item.screenshot.reduce((screenshots, item) => { + screenshots += `
`; + return screenshots; + }, ''); + + return { + title: `${item.name}-${item.description}`, + link: `https://minapp.com/miniapp/${item.id}/`, + description: ` + ${item.name}
+ ${item.description}

+

+ 截图:
+ ${screenshots} + `, + pubDate: new Date(item.created_at * 1000).toUTCString(), + author: item.created_by, + }; + }), + }; +};