From 99dd1f772ab55852a520acbec422a6f802fdb012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A7=E5=85=8B=E5=8A=9B=E5=86=B0=E6=BF=80=E5=87=8C?= <121017405@qq.com> Date: Wed, 27 May 2020 14:14:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E4=BA=BA=E4=BA=BA=E5=BD=B1=E8=A7=86-=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=20(#4857)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/multimedia.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/rrys/review.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 lib/routes/rrys/review.js diff --git a/docs/multimedia.md b/docs/multimedia.md index 28139f4d7..861cca627 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -395,6 +395,12 @@ pageClass: routes +## 人人影视 + +### 评测推荐 + + + ## 色花堂中文论坛 ### 分区帖子 diff --git a/lib/router.js b/lib/router.js index 57901c502..4b7792a04 100644 --- a/lib/router.js +++ b/lib/router.js @@ -875,6 +875,9 @@ router.get('/btzj/:type?', require('./routes/btzj/index')); // 人生05电影网 router.get('/rs05/rs05', require('./routes/rs05/rs05')); +// 人人影视 (评测推荐) +router.get('/rrys/review', require('./routes/rrys/review')); + // 趣头条 router.get('/qutoutiao/category/:cid', require('./routes/qutoutiao/category')); diff --git a/lib/routes/rrys/review.js b/lib/routes/rrys/review.js new file mode 100644 index 000000000..35c67cd1f --- /dev/null +++ b/lib/routes/rrys/review.js @@ -0,0 +1,30 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const baseURL = 'http://www.rrys2019.com'; + +module.exports = async (ctx) => { + const response = await got.get(baseURL + '/article'); + + const $ = cheerio.load(response.data); + const list = $('.article-list li'); + ctx.state.data = { + title: '人人影视-评测推荐', + link: baseURL + '/article', + item: + list && + list + .map((index, item) => { + item = $(item); + const itemPicUrl = item.find('.fl-img img').attr('src'); + const itemDesc = item.find('.fl-info p').text().split('By')[0]; + return { + title: item.find('.fl-info h3 a').text(), + author: item.find('.fl-info p a').text(), + description: `描述:${itemDesc}
`, + link: baseURL + item.find('.fl-info h3 a').attr('href'), + }; + }) + .get(), + }; +};