rsshub
Version:
Make RSS Great Again!
78 lines (76 loc) • 2.88 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import { t as ViewType } from "./types-gOySfSXJ.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import { t as timezone } from "./timezone-CA9Huotp.mjs";
//#region lib/routes/techflowpost/featured.ts
const route = {
path: "/featured/:category?",
categories: ["finance"],
view: ViewType.Articles,
example: "/techflowpost/featured",
parameters: { category: "分类,见下表,默认为全部" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["techflowpost.com/article/index.html"] }],
name: "精选",
maintainers: ["zhenlohuang"],
handler,
url: "techflowpost.com/article/index.html",
description: `| 全部 | 行业 & 项目观察 | 项目简介 | 项目动态 | 赛道解读 | 播客笔记 | 交易观察 | VC洞察 | 实用教程 | 人物故事 & 访谈 | 法律 & 监管动态 | 活动动态 | 交易所动态 |
| ---- | --------------- | -------- | -------- | -------- | -------- | -------- | ------ | -------- | --------------- | --------------- | -------- | ---------- |
| | 2040 | 2046 | 2047 | 2045 | 2044 | 2043 | 2042 | 2041 | 2039 | 2033 | 2032 | 2031 |`
};
const categoryMap = {
"2040": "行业 & 项目观察",
"2046": "项目简介",
"2047": "项目动态",
"2045": "赛道解读",
"2044": "播客笔记",
"2043": "交易观察",
"2042": "VC洞察",
"2041": "实用教程",
"2039": "人物故事 & 访谈",
"2033": "法律 & 监管动态",
"2032": "活动动态",
"2031": "交易所动态"
};
async function handler(ctx) {
const category = ctx.req.param("category") ?? "";
const limit = ctx.req.query("limit") ?? 50;
const rootUrl = "https://www.techflowpost.com";
const currentUrl = `${rootUrl}/article/index.html`;
const formData = {
pageindex: 1,
pagesize: limit,
is_specialnews: "N"
};
if (category) formData.ncata_id = category;
const { data: response } = await got_default.post("https://www.techflowpost.com/ashx/index.ashx", { form: formData });
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
}));
return {
title: `深潮TechFlow - 精选文章${category && categoryMap[category] ? `(${categoryMap[category]})` : ""}`,
link: currentUrl,
item: items
};
}
//#endregion
export { route };