parent
193ef153ea
commit
aed981c4ff
|
|
@ -62,6 +62,9 @@ pageClass: routes
|
|||
|
||||
<Route author="nczitzk" example="/gelonghui/keyword/ 早报" path="/gelonghui/keyword/:keyword" :paramsDesc="[' 搜索关键字']/>
|
||||
|
||||
## 金十数据
|
||||
|
||||
<Route author="laampui" example="/jinshi/index" path="/jinshi/index" />
|
||||
## 世界经济论坛
|
||||
|
||||
### 报告
|
||||
|
|
|
|||
|
|
@ -1868,6 +1868,9 @@ router.get('/im2maker/:channel?', require('./routes/im2maker/index'));
|
|||
// 巨潮资讯
|
||||
router.get('/cninfo/announcement/:column/:code/:orgId/:category?', require('./routes/cninfo/announcement'));
|
||||
|
||||
// 金十数据
|
||||
router.get('/jinshi/index', require('./routes/jinshi/index'));
|
||||
|
||||
// 中央纪委国家监委网站
|
||||
router.get('/ccdi/scdc', require('./routes/ccdi/scdc'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got.get('https://www.jin10.com/');
|
||||
const $ = cheerio.load(response.data);
|
||||
const item = [];
|
||||
let month_day;
|
||||
|
||||
$('#jin_flash_list .jin-flash-item-container').each((index, ele) => {
|
||||
const year = new Date().getFullYear();
|
||||
const new_month_day = $('.jin-flash-date-line span', ele).text().trim();
|
||||
new_month_day && (month_day = new_month_day);
|
||||
const month = month_day.match(/\d+/g)[0];
|
||||
const day = month_day.match(/\d+/g)[1];
|
||||
const time = $('.item-time', ele).text();
|
||||
const date = new Date(`${year}-${month}-${day} ${time}`);
|
||||
|
||||
item.push({
|
||||
title: $('.right-content div:first-of-type', ele).text(),
|
||||
link: $('.right-content .flash-item-share_right a', ele).attr('href'),
|
||||
description: `${year}-${month}-${day} ${time}`,
|
||||
pubDate: date.toUTCString(),
|
||||
});
|
||||
});
|
||||
ctx.state.data = {
|
||||
title: '金十数据',
|
||||
link: 'https://www.jin10.com/',
|
||||
item: item,
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue