feat(route): add 电脑玩物 (#14486)
* 增加电脑玩物 * style: auto format * Update radar.js --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
f867ada76f
commit
2c20ad3092
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/': ['cnkmmk'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'playpcesor.com': {
|
||||
_name: '电脑玩物',
|
||||
'.': [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/routes/blog#dian-nao-wan-wu',
|
||||
source: ['/'],
|
||||
target: '/playpcesor',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/', require('./rss'));
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
const { parseDate } = require('@/utils/parse-date');
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'https://www.playpcesor.com/';
|
||||
const response = await got({ method: 'get', url });
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const list = $("article[class='post-outer-container']")
|
||||
.map((i, e) => {
|
||||
const element = $(e);
|
||||
const title = element.find('h3 > a').text();
|
||||
const link = element.find('h3 > a').attr('href');
|
||||
const description = element.find('div[class="snippet-item r-snippetized"]').text();
|
||||
const dateraw = element.find('time').attr('datetime');
|
||||
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
link,
|
||||
pubDate: parseDate(dateraw, 'YYYY-MM-DDTHH:mm:ss+08:00'),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '电脑玩物',
|
||||
link: url,
|
||||
item: list,
|
||||
};
|
||||
};
|
||||
|
|
@ -312,6 +312,12 @@
|
|||
| windows | android | tutorial | other |
|
||||
</Route>
|
||||
|
||||
## 电脑玩物 {#dian-nao-wan-wu}
|
||||
|
||||
### 博客 {#dian-nao-wan-wu-bo-ke}
|
||||
|
||||
<Route author="cnkmmk" example="/playpcesor" path="/playpcesor" radar="1" />
|
||||
|
||||
## 纷享销客 CRM {#fen-xiang-xiao-ke-crm}
|
||||
|
||||
### 文章 {#fen-xiang-xiao-ke-crm-wen-zhang}
|
||||
|
|
|
|||
Loading…
Reference in New Issue