From 79d449b5f1082a7436d2a77e1e61cd70d13b8357 Mon Sep 17 00:00:00 2001 From: monnerHenster Date: Mon, 28 Jan 2019 17:47:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E7=94=9F05=E7=9A=84?= =?UTF-8?q?=E7=94=B5=E5=BD=B1=E4=B8=8B=E8=BD=BD=E7=BD=91=E7=AB=99=20(#1459?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 4 ++++ lib/router.js | 3 +++ lib/routes/rs05/rs05.js | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 lib/routes/rs05/rs05.js diff --git a/docs/README.md b/docs/README.md index 16c5e38df..2ba35f3a1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -946,6 +946,10 @@ GitHub 官方也提供了一些 RSS: +### rs05 人生 05 电影 + + + ### 优酷 diff --git a/lib/router.js b/lib/router.js index ebc923bf3..8b473bab3 100644 --- a/lib/router.js +++ b/lib/router.js @@ -744,6 +744,9 @@ router.get('/kirara/news', require('./routes/kirara/news')); router.get('/dytt', require('./routes/dytt/index')); router.get('/dytt/index', require('./routes/dytt/index')); // 兼容 +// 人生05电影网 +router.get('/rs05/rs05', require('./routes/rs05/rs05')); + // 趣头条 router.get('/qutoutiao/category/:cid', require('./routes/qutoutiao/category')); diff --git a/lib/routes/rs05/rs05.js b/lib/routes/rs05/rs05.js new file mode 100644 index 000000000..b292c614b --- /dev/null +++ b/lib/routes/rs05/rs05.js @@ -0,0 +1,36 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: 'http://www.rs05.com/movie/', + headers: { + Referer: 'http://www.rs05.com/movie/', + }, + }); + + const data = response.data; + + const $ = cheerio.load(data); + const list = $('.list ul li'); + + ctx.state.data = { + title: '人生05电影更新列表', + link: 'http://www.rs05.com/movie/', + description: '人生05电影更新列表', + item: + list && + list + .map((index, item) => { + item = $(item); + return { + title: item.find('.intro h2 a').attr('title'), + description: item.find('.brief').text() + '', + pubDate: new Date(item.find('.time').data('shared-at')).toUTCString(), + link: item.find('.intro h2 a').attr('href'), + }; + }) + .get(), + }; +};