feat: add 中国庭审公开网 (#6781)
This commit is contained in:
parent
5ea6a49754
commit
ad88d2dc4b
|
|
@ -217,6 +217,12 @@ pageClass: routes
|
|||
|
||||
</Route>
|
||||
|
||||
## 中国庭审公开网
|
||||
|
||||
### 开庭信息
|
||||
|
||||
<Route author="Fatpandac" example="/tingshen" path="/tingshen"/>
|
||||
|
||||
## 中国信息通信研究院
|
||||
|
||||
### 白皮书
|
||||
|
|
|
|||
|
|
@ -3894,4 +3894,7 @@ router.get('/dxy/vaccine/:province?/:city?/:location?', require('./routes/dxy/va
|
|||
// Wtu
|
||||
router.get('/wtu/:type', require('./routes/universities/wtu'));
|
||||
|
||||
// 中国庭审公开网
|
||||
router.get('/tingshen', require('./routes/tingshen/tingshen'));
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require('url').resolve;
|
||||
|
||||
const host = 'http://tingshen.court.gov.cn/preview';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got.get(host);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('ul[class="_preview_ul"]').find('li');
|
||||
ctx.state.data = {
|
||||
title: '中国庭审公开',
|
||||
link: host,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a[class="ellipsis22"]').text(),
|
||||
description: '开庭法院:' + item.find('span[class="show-col show-court-name"]').find('a[target="_blank"]').text() + '\n时间:' + item.find('span[class="show-col show-time"]').text(),
|
||||
pubDate: new Date(item.find('span[class="pull-right nes-date"]').text()).toUTCString(),
|
||||
link: url(host, item.find('a[class="ellipsis22"]').attr('href')),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue