mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 15:21:59 +08:00
* fix(route): hk01 get fulltext and refactor to V2 * Update lib/v2/hk01/channel.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/hk01/issue.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * fix: teaser pubDate
22 lines
824 B
JavaScript
22 lines
824 B
JavaScript
const got = require('@/utils/got');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const response = await got('https://web-data.api.hk01.com/v2/page/hot/');
|
|
const data = response.data;
|
|
const list = data.items;
|
|
|
|
ctx.state.data = {
|
|
title: '香港01 - 熱門',
|
|
description: data.meta.metaDesc,
|
|
link: data.meta.canonicalUrl,
|
|
item: list.map((item) => ({
|
|
title: item.data.title,
|
|
author: item.data.authors && item.data.authors.map((e) => e.publishName).join(', '),
|
|
description: `<p>${item.data.description}</p><img style="width: 100%" src="${item.data.mainImage.cdnUrl}" />`,
|
|
pubDate: parseDate(item.data.lastModifyTime * 1000),
|
|
link: item.data.canonicalUrl,
|
|
})),
|
|
};
|
|
};
|