diff --git a/docs/program-update.md b/docs/program-update.md index 070c1b4982..ba541b6efe 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -152,6 +152,18 @@ pageClass: routes 见 [#怪物猎人](/game.html#怪物猎人) +## 厚墨 + +### 书源更新 + + + +| 1212 | 2000 | 2333 | 6666 | 9251 | 9713 | +| ---- | ---- | ---- | ------ | ---- | ---- | +| 沚水 | 楚观 | 纯二 | 张小晚 | 归谜 | 旧人 | + + + ## 腾讯云移动直播 SDK ### 更新日志 diff --git a/lib/router.js b/lib/router.js index db3bb1d4ca..c024805bc4 100644 --- a/lib/router.js +++ b/lib/router.js @@ -1678,4 +1678,7 @@ router.get('/cfan/news', require('./routes/cfan/news')); // 搜狐 - 搜狐号 router.get('/sohu/mp/:id', require('./routes/sohu/mp')); +// 厚墨书源索引 +router.get('/houmo/:code?', require('./routes/houmo/booksource')); + module.exports = router; diff --git a/lib/routes/houmo/booksource.js b/lib/routes/houmo/booksource.js new file mode 100644 index 0000000000..47f8c3a86c --- /dev/null +++ b/lib/routes/houmo/booksource.js @@ -0,0 +1,51 @@ +const got = require('@/utils/got'); + +const url = 'http://qingmo.zohar.space/git/repository.json'; +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: url, + }); + + const code = ctx.params.code; + + const list = response.data.list; + + if (!code) { + ctx.state.data = { + title: `BookSource`, + link: url, + description: `厚墨书源索引`, + item: list.map((item) => { + const author = item.name.match(/(.*?)-/g)[0].replace('-', ''); + return { + title: item.name + ` v` + item.version, + description: `

作者: ${author}

暗码: ${item.code}

tg群: @deepinkapp

论坛地址: https://andyt.cn/

`, + link: item.url.replace('real site => ', ''), + author: author, + }; + }), + }; + } else { + const items = []; + list.map((item) => { + const author = item.name.match(/(.*?)-/g)[0].replace('-', ''); + if (item.code === code) { + items.push({ + title: item.name + ` v` + item.version, + description: `

作者: ${author}

tg群: @deepinkapp

论坛地址: https://andyt.cn/

`, + link: item.url.replace('real site => ', ''), + author: author, + }); + } + return 0; + }); + + ctx.state.data = { + title: `${code} - BookSource`, + link: url, + description: `暗码: ${code} - 厚墨书源索引`, + item: items, + }; + } +};