fix(route): techflowpost (#14684)

This commit is contained in:
Tony 2024-03-06 22:28:13 +08:00 committed by GitHub
parent fb1d38590d
commit 0a82e22fb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 39 additions and 41 deletions

View File

@ -1,28 +1,26 @@
import got from '@/utils/got';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { unescapeAll } from 'markdown-it/lib/common/utils.mjs';
import dayjs from 'dayjs';
export default async (ctx) => {
const rootUrl = 'https://www.techflowpost.com';
const apiRootUrl = 'https://data.techflowpost.com';
const currentUrl = `${rootUrl}/express`;
const apiUrl = `${apiRootUrl}/api/pc/express/all?pageIndex=0&pageSize=${ctx.req.query('limit') ?? 50}`;
const currentUrl = `${rootUrl}/newsletter/index.html`;
const response = await got({
method: 'post',
url: apiUrl,
json: {
createTime: [],
const { data: response } = await got.post('https://www.techflowpost.com/ashx/newflash_index.ashx', {
form: {
pageindex: 1,
pagesize: ctx.req.query('limit') ?? 50,
time: dayjs().format('YYYY/M/D HH:mm:ss'),
},
});
const items = response.data.content.map((item) => ({
title: item.title,
link: `${rootUrl}/express/${item.id}`,
category: item.tags?.split('') ?? [],
pubDate: timezone(parseDate(item.createTime), +8),
description: unescapeAll(item.content),
const items = response.content.map((item) => ({
title: item.stitle,
link: `${rootUrl}/newsletter/detail_${item.nnewflash_id}.html`,
pubDate: timezone(parseDate(item.dcreate_time), +8),
updated: timezone(parseDate(item.dmodi_time), +8),
description: item.scontent,
}));
ctx.set('data', {

View File

@ -1,25 +1,25 @@
import got from '@/utils/got';
import timezone from '@/utils/timezone';
import { parseDate } from '@/utils/parse-date';
import { unescapeAll } from 'markdown-it/lib/common/utils.mjs';
export default async (ctx) => {
const rootUrl = 'https://www.techflowpost.com';
const apiRootUrl = 'https://data.techflowpost.com';
const apiUrl = `${apiRootUrl}/api/pc/home/more?pageIndex=0&pageSize=${ctx.req.query('limit') ?? 50}`;
const response = await got({
method: 'get',
url: apiUrl,
const { data: response } = await got.post('https://www.techflowpost.com/ashx/index.ashx', {
form: {
pageindex: 1,
pagesize: ctx.req.query('limit') ?? 50,
},
});
const items = response.data.content.map((item) => ({
title: item.title,
author: item.source,
link: `${rootUrl}/article/${item.id}`,
category: item.tagList.map((t) => t.name),
pubDate: timezone(parseDate(item.createTime), +8),
description: unescapeAll(item.content),
const items = response.content.map((item) => ({
title: item.stitle,
author: item.sauthor_name,
link: `${rootUrl}/article/detail_${item.narticle_id}.html`,
category: [item.new_scata_name],
pubDate: timezone(parseDate(item.dcreate_time), +8),
updated: timezone(parseDate(item.dmodi_time), +8),
description: item.scontent,
}));
ctx.set('data', {

View File

@ -4,14 +4,14 @@ export default {
'.': [
{
title: '首页',
docs: 'https://docs.rsshub.app/routes/new-media#shen-chao-techflow-shou-ye',
docs: 'https://docs.rsshub.app/routes/finance#shen-chao-techflow-shou-ye',
source: ['/'],
target: '/techflowpost',
},
{
title: '快讯',
docs: 'https://docs.rsshub.app/routes/new-media#shen-chao-techflow-kuai-xun',
source: ['/express'],
docs: 'https://docs.rsshub.app/routes/finance#shen-chao-techflow-kuai-xun',
source: ['/newsletter/index.html'],
target: '/techflowpost/express',
},
],

View File

@ -617,6 +617,16 @@ TokenInsight also provides official RSS, you can take a look at [https://api.tok
<Route author="Jeason0228" example="/sse/inquire" path="/sse/inquire" radar="1" />
## 深潮 TechFlow {#shen-chao-techflow}
### 首页 {#shen-chao-techflow-shou-ye}
<Route author="nczitzk" example="/techflowpost" path="/techflowpost" radar="1" />
### 快讯 {#shen-chao-techflow-kuai-xun}
<Route author="nczitzk" example="/techflowpost/express" path="/techflowpost/express" radar="1" />
## 深圳证券交易所 {#shen-zhen-zheng-quan-jiao-yi-suo}
### 上市公告 - 可转换债券 {#shen-zhen-zheng-quan-jiao-yi-suo-shang-shi-gong-gao-ke-zhuan-huan-zhai-quan}

View File

@ -4240,16 +4240,6 @@
<Route author="Jeason0228" example="/sspai/tag/apple" path="/sspai/tag/:keyword" paramsDesc={['关键词']} radar="1" />
## 深潮 TechFlow {#shen-chao-techflow}
### 首页 {#shen-chao-techflow-shou-ye}
<Route author="nczitzk" example="/techflowpost" path="/techflowpost" notOperational="1" />
### 快讯 {#shen-chao-techflow-kuai-xun}
<Route author="nczitzk" example="/techflowpost/express" path="/techflowpost/express" notOperational="1" />
## 深圳新闻网 {#shen-zhen-xin-wen-wang}
### 深圳市政府新闻发布厅 {#shen-zhen-xin-wen-wang-shen-zhen-shi-zheng-fu-xin-wen-fa-bu-ting}