From f14a24558e5aa00a2250eba5684693b6aaf21e99 Mon Sep 17 00:00:00 2001 From: CoderTonyChan <101992315@qq.com> Date: Wed, 13 Feb 2019 14:30:21 +0800 Subject: [PATCH] add Vol.mol (#1538) add Vol.moe ![image](https://user-images.githubusercontent.com/16996753/52684793-69469c80-2f82-11e9-9a67-7b47ef79879f.png) --- docs/README.md | 10 +++++++ docs/en/README.md | 10 +++++++ lib/router.js | 2 ++ lib/routes/vol/lastupdate.js | 52 ++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 lib/routes/vol/lastupdate.js diff --git a/docs/README.md b/docs/README.md index 5bce90321..2ef81a2e3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1163,6 +1163,16 @@ GitHub 官方也提供了一些 RSS: +### Vol.moe + + + +| 连载 | 完结 | +| ------ | ----- | +| serial | finsh | + + + ### ebb.io diff --git a/docs/en/README.md b/docs/en/README.md index 1dc603b91..07f073e9e 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -249,6 +249,16 @@ For private channels, pass the channel `id` (such as `-1001001234567`) intstead +## ACG + +### Vol.moe + + + +| Comics are serialized | Comics is finshed | +| --------------------- | ----------------- | +| serial | finsh | + ## Travel ### All the Flight Deals diff --git a/lib/router.js b/lib/router.js index eb3ced727..fcbe0b21b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -868,6 +868,8 @@ router.get('/tencentvideo/playlist/:id', require('./routes/tencent/video/playlis router.get('/manhuagui/comic/:id', require('./routes/manhuagui/comic')); // 動漫狂 router.get('/cartoonmad/comic/:id', require('./routes/cartoonmad/comic')); +// Vol +router.get('/vol/:mode?', require('./routes/vol/lastupdate')); // Tits Guru router.get('/tits-guru/home', require('./routes/titsguru/home')); diff --git a/lib/routes/vol/lastupdate.js b/lib/routes/vol/lastupdate.js new file mode 100644 index 000000000..d58033594 --- /dev/null +++ b/lib/routes/vol/lastupdate.js @@ -0,0 +1,52 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + let mode = ctx.params.mode; + let title = ``; + if (mode === 'serial') { + mode = '%E9%80%A3%E8%BC%89'; + title = `Vol.moe - serial`; + } else if (mode === 'finish') { + mode = '%E5%AE%8C%E7%B5%90'; + title = `Vol.moe - finish`; + } else { + mode = 'all'; + title = `Vol.moe`; + } + const link = `http://vol.moe/list/all,all,${mode},lastupdate,all,all,none/`; + const listData = await axios.get(link); + const $list = cheerio.load(listData.data); + const items = $list('.listbg td') + .map((_, el) => { + const $el = $list(el); + const title = $el + .find('a') + .last() + .text(); + const imgEL = $el.find('a').first(); + const link = imgEL.attr('href'); + const imgSrc = imgEL.find('.img_book').attr('src'); + const match = $el.text().match(/\[[\s\S]*?\]/g); + const detail = $el.find('.pagefoot').text(); + const date = $el.find('.filesize').text(); + return { + title: `${title} ${detail} ${match}`, + description: ` + +

${title}

+

${match}

+

${detail}

+

${date}

+ `.trim(), + link: link, + pubDate: new Date(date).toUTCString(), + }; + }) + .get(); + ctx.state.data = { + title, + link, + item: items, + }; +};