diff --git a/docs/program-update.md b/docs/program-update.md index ec95ef7ace..a300754039 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -260,6 +260,12 @@ pageClass: routes +## 腾讯柠檬 Lab + +### 柠檬精选 Mac Apps + + + ## 腾讯云移动直播 SDK ### 更新日志 diff --git a/docs/programming.md b/docs/programming.md index 5466d9badb..a2305acb0c 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -155,7 +155,7 @@ GitHub 官方也提供了一些 RSS: -## Go语言中文网 +## Go 语言中文网 ### 周刊 diff --git a/lib/router.js b/lib/router.js index 7718da0249..0ca7e7f696 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2005,6 +2005,9 @@ router.get('/sohu/mp/:id', require('./routes/sohu/mp')); // 腾讯企鹅号 router.get('/tencent/news/author/:mid', require('./routes/tencent/news/author')); +// 腾讯柠檬精选 +router.get('/tencent/lemon', require('./routes/tencent/lemon/index')); + // 奈菲影视 router.get('/nfmovies/:id?', require('./routes/nfmovies/index')); diff --git a/lib/routes/tencent/lemon/index.js b/lib/routes/tencent/lemon/index.js new file mode 100644 index 0000000000..d3816da822 --- /dev/null +++ b/lib/routes/tencent/lemon/index.js @@ -0,0 +1,29 @@ +const got = require('@/utils/got'); +const date = require('@/utils/date'); + +module.exports = async (ctx) => { + const url = 'https://lemon.qq.com/lab/js/source.js'; + + let data = (await got.get(url)).data.match(/(?<=(var list = ))(.*)(\])/gs)[0]; + + // eslint-disable-next-line no-eval + data = eval('(' + data + ')').slice(0, 10); + + const items = data.map((i) => ({ + title: i.name, + description: ` + ${i.comment}
+
+ 下载链接 + `, + link: `https://lemon.qq.com/lab/app/${i.shortname}.html`, + author: i.referrer, + pubDate: date(i.date), + })); + + ctx.state.data = { + title: '腾讯柠檬精选', + link: 'https://lemon.qq.com/lab/', + item: items, + }; +};