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>
This commit is contained in:
parent
f84d399fd6
commit
6b24b91f00
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/': ['cnkmmk'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'free.com.tw': {
|
||||
_name: '免費資源網路社群',
|
||||
'.': [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/routes/blog#mian-fei-zi-yuan-wang-lu-she-qun',
|
||||
source: ['/'],
|
||||
target: '/free',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/', require('./rss'));
|
||||
};
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
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,
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -396,6 +396,12 @@
|
|||
|
||||
<Route author="LogicJake" example="/security/pulses" path="/security/pulses" anticrawler="1" />
|
||||
|
||||
## 免費資源網路社群 {#mian-fei-zi-yuan-wang-lu-she-qun}
|
||||
|
||||
### 博客 {#mian-fei-zi-yuan-wang-lu-she-qun-bo-ke}
|
||||
|
||||
<Route author="cnkmmk" example="/free" path="/free" />
|
||||
|
||||
## 十年之约 {#shi-nian-zhi-yue}
|
||||
|
||||
### 专题展示 - 文章 {#shi-nian-zhi-yue-zhuan-ti-zhan-shi-wen-zhang}
|
||||
|
|
|
|||
Loading…
Reference in New Issue