mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
@@ -2965,3 +2965,7 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看
|
||||
### 鲸跃汽车
|
||||
|
||||
<route name="首页" author="LogicJake" example="/whalegogo/home" path="/whalegogo/home"/>
|
||||
|
||||
### 每日安全
|
||||
|
||||
<route name="推送" author="LogicJake" example="/security/pulses" path="/security/pulses"/>
|
||||
|
||||
@@ -1065,4 +1065,7 @@ router.get('/hupu/bxj/:id/:order?', require('./routes/hupu/bxj'));
|
||||
// 牛客网
|
||||
router.get('/nowcoder/discuss/:type/:order', require('./routes/nowcoder/discuss'));
|
||||
|
||||
// 每日安全
|
||||
router.get('/security/pulses', require('./routes/security/pulses'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
43
lib/routes/security/pulses.js
Normal file
43
lib/routes/security/pulses.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require('url');
|
||||
|
||||
const host = 'https://sec.today';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const link = 'https://sec.today/pulses/';
|
||||
const response = await axios.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const out = $('div.endless_page_template div.row')
|
||||
.slice(0, 10)
|
||||
.map(function() {
|
||||
const author = $(this)
|
||||
.find('div.card-text small.text-muted')
|
||||
.text()
|
||||
.trim()
|
||||
.split('•')[0];
|
||||
|
||||
const itemUrl = $(this)
|
||||
.find('p.card-text.my-3 > a')
|
||||
.attr('href');
|
||||
const info = {
|
||||
link: url.resolve(host, itemUrl),
|
||||
description: $(this)
|
||||
.find('p.card-text.my-1')
|
||||
.html(),
|
||||
title: $(this)
|
||||
.find('h5.card-title')
|
||||
.text(),
|
||||
author: author,
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '每日安全推送',
|
||||
link: link,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user