mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-13 00:35:19 +08:00
* feat(route): 三联生活周刊 * fix: namespace and data acquirement * fix: get article list by api * Update lib/v2/lifeweek/channel.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/lifeweek/channel.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/lifeweek/tag.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * fix: rss url * refactor: getRssItem function * Update lib/v2/lifeweek/utils.js --------- Co-authored-by: Changren Wang <changren.wcr@alibaba-inc.com>
19 lines
588 B
JavaScript
19 lines
588 B
JavaScript
const got = require('@/utils/got');
|
|
const timezone = require('@/utils/timezone');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
const articleApiRootUrl = 'https://www.lifeweek.com.cn/api/article';
|
|
|
|
async function getRssItem(item, articleLink) {
|
|
const articleApiLink = `${articleApiRootUrl}/${item.id}`;
|
|
const { data } = await got(articleApiLink);
|
|
const time = timezone(parseDate(item.pubTime), +8);
|
|
return {
|
|
title: item.title,
|
|
description: data.model.content,
|
|
link: articleLink,
|
|
pubDate: time,
|
|
};
|
|
}
|
|
|
|
module.exports = getRssItem;
|