feat: add 腾讯柠檬精选 (#5066)

This commit is contained in:
Henry Wang
2020-06-28 04:20:10 +01:00
committed by GitHub
parent 568184b911
commit 4b51ba54f4
4 changed files with 39 additions and 1 deletions

View File

@@ -260,6 +260,12 @@ pageClass: routes
<Route author="zytomorrow" example="/pgyer/:app" path="/pgyer/kz-test" :paramsDesc="['app为下载页最后的路径']" radar="1"/> <Route author="zytomorrow" example="/pgyer/:app" path="/pgyer/kz-test" :paramsDesc="['app为下载页最后的路径']" radar="1"/>
## 腾讯柠檬 Lab
### 柠檬精选 Mac Apps
<Route author="HenryQW" example="/tencent/lemon" path="/tencent/lemon"/>
## 腾讯云移动直播 SDK ## 腾讯云移动直播 SDK
### 更新日志 ### 更新日志

View File

@@ -155,7 +155,7 @@ GitHub 官方也提供了一些 RSS:
</Route> </Route>
## Go语言中文网 ## Go 语言中文网
### 周刊 ### 周刊

View File

@@ -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/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')); router.get('/nfmovies/:id?', require('./routes/nfmovies/index'));

View File

@@ -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}</br>
<img src="${i.logo}"></br>
<a href="${i.downloadlink}">下载链接</a>
`,
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,
};
};