Files
RSSHub/lib/v2/lifeweek/utils.js
T
a01c645757 feat(route): 三联生活周刊 (#14127)
* 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>
2023-12-30 23:13:13 +08:00

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;