mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
24 lines
705 B
JavaScript
24 lines
705 B
JavaScript
const got = require('@/utils/got');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
const host = 'https://chaping.cn';
|
|
|
|
module.exports = async (ctx) => {
|
|
const newflashAPI = `${host}/api/official/information/newsflash?page=1&limit=21`;
|
|
const response = await got(newflashAPI).json();
|
|
const data = response.data;
|
|
|
|
ctx.state.data = {
|
|
title: '差评 快讯',
|
|
link: `${host}/newsflash`,
|
|
item:
|
|
data &&
|
|
data.map((item) => ({
|
|
title: item.title,
|
|
description: item.summary,
|
|
pubDate: parseDate(item.time_publish_timestamp * 1000),
|
|
link: item.origin_url,
|
|
})),
|
|
};
|
|
};
|