mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
feat(route): add 国外主机测评 (#14633)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/': ['cnkmmk'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'zhujiceping.com': {
|
||||
_name: '国外主机测评',
|
||||
'.': [
|
||||
{
|
||||
title: '最新发布',
|
||||
docs: 'https://docs.rsshub.app/routes/blog#guo-wai-zhu-ji-ce-ping',
|
||||
source: ['/'],
|
||||
target: '/zhujiceping',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export default (router) => {
|
||||
router.get('/', './rss');
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
|
||||
export default async (ctx) => {
|
||||
const url = 'https://www.zhujiceping.com/';
|
||||
const response = await got({ method: 'get', url });
|
||||
const $ = load(response.data);
|
||||
|
||||
const list = $('article.excerpt')
|
||||
.map((i, e) => {
|
||||
const element = $(e);
|
||||
const title = element.find('h2 > a').attr('title');
|
||||
const link = element.find('h2 > a').attr('href');
|
||||
const description = element.find('p.note').text();
|
||||
const dateraw = element.find('time').text();
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
link,
|
||||
pubDate: parseDate(dateraw, 'YYYY-MM-DD'),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.set('data', {
|
||||
title: '国外主机测评',
|
||||
link: url,
|
||||
item: list,
|
||||
});
|
||||
};
|
||||
@@ -491,3 +491,9 @@
|
||||
### 上周热门 TOP 20 {#zhu-bai-shang-zhou-re-men-top-20}
|
||||
|
||||
<Route author="nczitzk" example="/zhubai/top20" path="/zhubai/top20" radar="1" />
|
||||
|
||||
## 国外主机测评 {#guo-wai-zhu-ji-ce-ping}
|
||||
|
||||
### 最新发布 {#guo-wai-zhu-ji-ce-ping-zui-xin-fa-bu}
|
||||
|
||||
<Route author="cnkmmk" example="/zhujiceping" path="/zhujiceping" />
|
||||
|
||||
Reference in New Issue
Block a user