mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 13:39:35 +08:00
feat(route): add 深潮TechFlow (#9965)
* feat(route): add 深潮TechFlow * fix: add category
This commit is contained in:
@@ -3108,6 +3108,21 @@ column 为 third 时可选的 category:
|
|||||||
|
|
||||||
<Route author="Jeason0228" example="/sspai/tag/apple" path="/sspai/tag/:keyword" :paramsDesc="['关键词']" radar="1"/>
|
<Route author="Jeason0228" example="/sspai/tag/apple" path="/sspai/tag/:keyword" :paramsDesc="['关键词']" radar="1"/>
|
||||||
|
|
||||||
|
## 深潮 TechFlow
|
||||||
|
|
||||||
|
### 分类
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/techflow520" path="/techflow520/:category?" :paramsDesc="['分类,见下表,默认为头条']">
|
||||||
|
|
||||||
|
| 头条 | 元宇宙 | 项目 | DeFi | 矿业 | 隐私计算 | 碳中和 | 活动 | NFT | 产业 |
|
||||||
|
| -- | --- | -- | ---- | -- | ---- | --- | -- | --- | -- |
|
||||||
|
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
### 快讯
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/techflow520/newsflash" path="/techflow520/newsflash"/>
|
||||||
|
|
||||||
## 深焦
|
## 深焦
|
||||||
|
|
||||||
### 分类
|
### 分类
|
||||||
|
|||||||
34
lib/v2/techflow520/index.js
Normal file
34
lib/v2/techflow520/index.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const { parseDate } = require('@/utils/parse-date');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const category = ctx.params.category ?? '头条';
|
||||||
|
|
||||||
|
const rootUrl = 'https://www.techflow520.com';
|
||||||
|
const apiUrl = `${rootUrl}/index/index/tab_centet`;
|
||||||
|
|
||||||
|
const response = await got({
|
||||||
|
method: 'post',
|
||||||
|
url: apiUrl,
|
||||||
|
form: {
|
||||||
|
offect: 0,
|
||||||
|
typename: category,
|
||||||
|
pageval: 50,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const items = response.data.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
link: `${rootUrl}/news/${item.id}`,
|
||||||
|
description: item.content,
|
||||||
|
pubDate: parseDate(item.time),
|
||||||
|
category: [item.keywords],
|
||||||
|
author: item.source,
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `深潮TechFlow - ${category}`,
|
||||||
|
link: rootUrl,
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
4
lib/v2/techflow520/maintainer.js
Normal file
4
lib/v2/techflow520/maintainer.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
'/newsflash': ['nczitzk'],
|
||||||
|
'/:category?': ['nczitzk'],
|
||||||
|
};
|
||||||
32
lib/v2/techflow520/newsflash.js
Normal file
32
lib/v2/techflow520/newsflash.js
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const { parseDate } = require('@/utils/parse-date');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const rootUrl = 'https://www.techflow520.com';
|
||||||
|
const currentUrl = `${rootUrl}/newflash`;
|
||||||
|
const apiUrl = `${rootUrl}/index/kuaixun/load_kuaixun`;
|
||||||
|
|
||||||
|
const response = await got({
|
||||||
|
method: 'post',
|
||||||
|
url: apiUrl,
|
||||||
|
form: {
|
||||||
|
offect: 0,
|
||||||
|
pageval: 50,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const items = response.data.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
link: `${rootUrl}/news/${item.id}`,
|
||||||
|
description: item.content,
|
||||||
|
pubDate: parseDate(item.time),
|
||||||
|
category: [item.keywords],
|
||||||
|
author: item.source,
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: '深潮TechFlow - 快讯',
|
||||||
|
link: currentUrl,
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
19
lib/v2/techflow520/radar.js
Normal file
19
lib/v2/techflow520/radar.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
module.exports = {
|
||||||
|
'techflow520.com': {
|
||||||
|
_name: '深潮TechFlow',
|
||||||
|
'.': [
|
||||||
|
{
|
||||||
|
title: '分类',
|
||||||
|
docs: 'https://docs.rsshub.app/new-media.html#shen-chao-techflow-fen-lei',
|
||||||
|
source: ['/'],
|
||||||
|
target: '/techflow520/:category?',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '快讯',
|
||||||
|
docs: 'https://docs.rsshub.app/new-media.html#shen-chao-techflow-kuai-xun',
|
||||||
|
source: ['/newsflash'],
|
||||||
|
target: '/techflow520/newsflash',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
4
lib/v2/techflow520/router.js
Normal file
4
lib/v2/techflow520/router.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = function (router) {
|
||||||
|
router.get('/newsflash', require('./newsflash'));
|
||||||
|
router.get('/:category?', require('./index'));
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user