mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: add hex-rays news (#3726)
This commit is contained in:
@@ -154,6 +154,13 @@ GitHub 官方也提供了一些 RSS:
|
|||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
## Hex-Rays
|
||||||
|
|
||||||
|
### Hex-Rays News
|
||||||
|
|
||||||
|
<Route author="hellodword" example="/hex-rays/news" path="/hex-rays/news">
|
||||||
|
</Route>
|
||||||
|
|
||||||
## ITSlide
|
## ITSlide
|
||||||
|
|
||||||
### 最新
|
### 最新
|
||||||
|
|||||||
@@ -2098,6 +2098,9 @@ router.get('/mlog-club/projects', require('./routes/mlog-club/projects'));
|
|||||||
// Chrome 网上应用店
|
// Chrome 网上应用店
|
||||||
router.get('/chrome/webstore/extensions/:id', require('./routes/chrome/extensions'));
|
router.get('/chrome/webstore/extensions/:id', require('./routes/chrome/extensions'));
|
||||||
|
|
||||||
|
// Hex-Rays News
|
||||||
|
router.get('/hex-rays/news', require('./routes/hex-rays/index'));
|
||||||
|
|
||||||
// 新趣集
|
// 新趣集
|
||||||
router.get('/xinquji/today', require('./routes/xinquji/today'));
|
router.get('/xinquji/today', require('./routes/xinquji/today'));
|
||||||
router.get('/xinquji/today/internal', require('./routes/xinquji/internal'));
|
router.get('/xinquji/today/internal', require('./routes/xinquji/internal'));
|
||||||
|
|||||||
35
lib/routes/hex-rays/index.js
Normal file
35
lib/routes/hex-rays/index.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
let host = 'https://www.hex-rays.com';
|
||||||
|
|
||||||
|
host = `${host}/news.shtml`;
|
||||||
|
|
||||||
|
const response = await got.get(host);
|
||||||
|
|
||||||
|
const $ = cheerio.load(response.data);
|
||||||
|
|
||||||
|
const list = $('tr[bgcolor]');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: 'Hex-Rays News',
|
||||||
|
link: host,
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
return {
|
||||||
|
title: item.find('td:nth-child(1)').text() + ' ' + item.find('td:nth-child(2)').text(),
|
||||||
|
link: item.find('td:nth-child(2) > a').attr('href'),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// 虽然能够用插件探测到疑似feed,但是实际请求会发现需要登录
|
||||||
|
// https://forum.hex-rays.com/app.php/feed/news
|
||||||
|
|
||||||
|
// 正文部分比较...乱且意义不大,所以没有正文
|
||||||
Reference in New Issue
Block a user