Files
RSSHub/lib/v2/techflow520/newsflash.js
Ethan Shen 0f3a0b76d4 feat(route): add 深潮TechFlow (#9965)
* feat(route): add 深潮TechFlow

* fix: add category
2022-06-16 20:06:47 +08:00

33 lines
834 B
JavaScript

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,
};
};