feat: add 绅士漫画 (#4241)

This commit is contained in:
Ken Mizz
2020-03-18 10:40:08 +08:00
committed by GitHub
parent 6a79ccfe7a
commit 6e07996a38
3 changed files with 41 additions and 0 deletions
+6
View File
@@ -266,3 +266,9 @@ pageClass: routes
### 最新汉化
<Route author="junfengP" example="/zdfx" path="/zdfx"/>
## 紳士漫畫
### 最新
<Route author="KenMizz" example="/ssmh" path="/ssmh/">
+3
View File
@@ -541,6 +541,9 @@ router.get('/sayhuahuo', require('./routes/galgame/sayhuahuo'));
// 终点分享
router.get('/zdfx', require('./routes/galgame/zdfx'));
// 紳士漫畫
router.get('/ssmh', require('./routes/ssmh'));
// 北京理工大学
router.get('/bit/jwc', require('./routes/universities/bit/jwc/jwc'));
router.get('/bit/cs', require('./routes/universities/bit/cs/cs'));
+32
View File
@@ -0,0 +1,32 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://wnacg.org/albums.html',
});
const data = response.data;
const $ = cheerio.load(data);
const list = $('.pic_box');
let thumbnail_url;
let link_url;
ctx.state.data = {
title: '紳士漫畫',
link: 'https://wnacg.org/albums.html',
item: list
.map((index, item) => {
item = $(item);
thumbnail_url = 'https://wnacg.org' + `${item.find('a > img').attr('src')}`;
link_url = 'https://wnacg.org' + `${item.find('a').attr('href')}`;
return {
title: item.find('a').attr('title'),
description: `<img src=${thumbnail_url} referrerpolicy="no-referrer">`,
link: link_url,
};
})
.get(),
};
};