mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-21 04:38:15 +08:00
* 增加 免費資源網路社群 * 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>
20 lines
630 B
JavaScript
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,
|
|
})),
|
|
};
|
|
};
|