mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 07:40:26 +08:00
feat: add checkra1n (#4289)
This commit is contained in:
@@ -50,6 +50,12 @@ pageClass: routes
|
|||||||
|
|
||||||
<Route author="hoilc" example="/centbrowser/history" path="/centbrowser/history"/>
|
<Route author="hoilc" example="/centbrowser/history" path="/centbrowser/history"/>
|
||||||
|
|
||||||
|
## Checkra1n
|
||||||
|
|
||||||
|
### 新版本发布
|
||||||
|
|
||||||
|
<Route author="ntzyz" example="/checkra1n/releases" path="/checkra1n/releases"/>
|
||||||
|
|
||||||
## Chocolatey
|
## Chocolatey
|
||||||
|
|
||||||
### 软件更新
|
### 软件更新
|
||||||
|
|||||||
@@ -2409,6 +2409,9 @@ router.get('/hubu/news/:type', require('./routes/universities/hubu/news'));
|
|||||||
// 大连海事大学
|
// 大连海事大学
|
||||||
router.get('/dlmu/news/:type', require('./routes/universities/dlmu/news'));
|
router.get('/dlmu/news/:type', require('./routes/universities/dlmu/news'));
|
||||||
|
|
||||||
|
// Checkra1n
|
||||||
|
router.get('/checkra1n/releases', require('./routes/checkra1n/releases'));
|
||||||
|
|
||||||
// 四川省科学技术厅
|
// 四川省科学技术厅
|
||||||
router.get('/sckjt/news/:type?', require('./routes/sckjt/news'));
|
router.get('/sckjt/news/:type?', require('./routes/sckjt/news'));
|
||||||
|
|
||||||
|
|||||||
35
lib/routes/checkra1n/releases.js
Normal file
35
lib/routes/checkra1n/releases.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const homepage = 'https://checkra.in/releases/';
|
||||||
|
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: homepage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const $ = cheerio.load(response.data);
|
||||||
|
const releases = $('.release');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `Checkra1n All Releases`,
|
||||||
|
link: homepage,
|
||||||
|
item: releases
|
||||||
|
.map((i, item) => {
|
||||||
|
const $item = $(item);
|
||||||
|
const address = 'https://checkra.in' + $item.find('a').attr('href');
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: $item
|
||||||
|
.find('h3')
|
||||||
|
.first()
|
||||||
|
.text(),
|
||||||
|
description: $item.find('.changelog').html(),
|
||||||
|
link: address,
|
||||||
|
guid: address,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user