Files
RSSHub/lib/v2/free/rss.js
T
6b24b91f00 feat(route): add 免費資源網路社群 (#14495)
* 增加 免費資源網路社群

* style: auto format

* 更新 rss.js

使用 wordpress 的 api 来获取数据

* 更新 rss.js

* 更新 rss.js

* 更新 rss.js

---------

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-20 00:28:39 +08:00

20 lines
630 B
JavaScript

const { parseDate } = require('@/utils/parse-date');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = 'https://free.com.tw/';
const response = await got(`${url}/wp-json/wp/v2/posts`);
const list = response.data;
ctx.state.data = {
title: '免費資源網路社群',
link: url,
description: '免費資源網路社群 - 全部文章',
item: list.map((item) => ({
title: item.title.rendered,
link: item.link,
pubDate: parseDate(item.date_gmt),
description: item.content.rendered,
})),
};
};