rss: add xclient app
This commit is contained in:
parent
91e01155e8
commit
4e51922e19
|
|
@ -1768,6 +1768,18 @@ GitHub 官方也提供了一些 RSS:
|
|||
|
||||
- project: 项目的短名或者 `Project ID`. 项目的短名可以在地址栏获取到, 例如地址为 `https://minecraft.curseforge.com/projects/non-update`, 短名就为 `non-update`. `Project ID` 可在 `Overview` 中的 `About This Project` 中找到
|
||||
|
||||
### xclient.info
|
||||
|
||||
#### 应用更新
|
||||
|
||||
举例: <https://rsshub.app/xclient/app/sketch>
|
||||
|
||||
路由: `/xclient/app/:name`
|
||||
|
||||
参数:
|
||||
|
||||
- name: 应用名,可在应用页 URL 中找到
|
||||
|
||||
## 大学通知
|
||||
|
||||
### 上海海事大学
|
||||
|
|
|
|||
|
|
@ -530,4 +530,7 @@ router.get('/douyin/user/:id', require('./routes/douyin/user'));
|
|||
// 少数派 sspai
|
||||
router.get('/sspai/series', require('./routes/sspai/series'));
|
||||
|
||||
// xclient.info
|
||||
router.get('/xclient/app/:name', require('./routes/xclient/app'));
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const name = ctx.params.name;
|
||||
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: `http://xclient.info/s/${name}.html`,
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data);
|
||||
const list = $('#versions tbody tr');
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link: `http://xclient.info/s/${name}.html`,
|
||||
description: $('meta[name="description"]').attr('content') || $('title').text(),
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
const td = item.find('td');
|
||||
return {
|
||||
title: td.eq(0).text(),
|
||||
description: `版本号:${td.eq(0).text()}<br>更新日期:${td.eq(2).text()}<br>文件大小:${td.eq(3).text()}`,
|
||||
pubDate: new Date(td.eq(2).text()).toUTCString(),
|
||||
link: `http://xclient.info/s/${name}.html`,
|
||||
guid: td.eq(0).text(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue