diff --git a/docs/anime.md b/docs/anime.md index 6781261a1..4deca406c 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -26,6 +26,10 @@ +## 终点分享 + + + ## 看漫画 diff --git a/lib/router.js b/lib/router.js index 1f9ddba63..8855142d3 100755 --- a/lib/router.js +++ b/lib/router.js @@ -572,6 +572,9 @@ router.get('/gitlab/explore/:type', require('./routes/gitlab/explore')); router.get('/mygalgame', require('./routes/galgame/mmgal')); router.get('/mmgal', require('./routes/galgame/mmgal')); +// 终点分享 +router.get('/zdfx', require('./routes/galgame/zdfx')); + // 大连工业大学 router.get('/dpu/jiaowu/news/:type?', require('./routes/universities/dpu/jiaowu/news')); router.get('/dpu/wlfw/news/:type?', require('./routes/universities/dpu/wlfw/news')); diff --git a/lib/routes/galgame/zdfx.js b/lib/routes/galgame/zdfx.js new file mode 100644 index 000000000..d1989c400 --- /dev/null +++ b/lib/routes/galgame/zdfx.js @@ -0,0 +1,30 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const host = 'https://bbs.zdfx.net/'; + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: host, + }); + const $ = cheerio.load(response.data); + const list = $('.slideother a'); + + const process = list.map((index, item) => { + const a = $(item); + const img_tag = '.slideshow a:nth-child(' + (index + 1).toString() + ')'; + + return { + title: a.text(), + description: $(img_tag).html(), + link: host + a.attr('href'), + }; + }); + + ctx.state.data = { + title: '终点分享', + link: host, + description: '终点分享最新汉化通知', + item: process.get(), + }; +};