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(), + }; +};