add 安全文摘 (#8294)
Co-authored-by: testkaili <testkaili@tencent.com> Co-authored-by: kaiili <kaii@openingsource.org>
This commit is contained in:
parent
0edd6a7387
commit
fc91df64d7
|
|
@ -450,6 +450,12 @@ GitHub 官方也提供了一些 RSS:
|
|||
|
||||
</Route>
|
||||
|
||||
## 安全文摘
|
||||
|
||||
### 首页
|
||||
|
||||
<Route author="kaiili" example="/secnews" path="/secnews" />
|
||||
|
||||
## 饿了么开放平台
|
||||
|
||||
### 商家开放平台公告
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'http://wiki.ioin.in/';
|
||||
const response = await got.get(String(url));
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('table>tbody>tr').get();
|
||||
const items = list.map((i) => {
|
||||
const item = $(i);
|
||||
const title = item.find('td:nth-child(2) a').text();
|
||||
const pla = item.find('.vul-type-item').text().replace(/\s+/g, '');
|
||||
const date = new Date(item.find('td:first-child').text().replace(/\s+/g, '')).toUTCString();
|
||||
const href = item.find('td:nth-child(2) a').attr('href');
|
||||
return {
|
||||
title: `${title} ${pla !== '未知' ? pla : ''}`,
|
||||
pubDate: date,
|
||||
link: `${url}${href}`,
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'sec-news',
|
||||
link: 'http://wiki.ioin.in/',
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/index': ['kaiili'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'furstar.jp': {
|
||||
_name: 'Furstar',
|
||||
'.': [
|
||||
{
|
||||
title: '安全文摘首頁',
|
||||
docs: 'https://docs.rsshub.app/shopping.html#an-quan-wen-zhai',
|
||||
source: ['/', '/'],
|
||||
target: '/secnews/index',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('', require('./index'));
|
||||
};
|
||||
Loading…
Reference in New Issue