添加 fir.im app 更新 (#457)

This commit is contained in:
Kevin
2018-08-13 14:19:50 +08:00
committed by DIYgod
parent 15a046fe4c
commit fb59c4721a
4 changed files with 44 additions and 0 deletions
+1
View File
@@ -19,6 +19,7 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
- Firefox
- 腾讯云移动直播 SDK
- Bugly SDK
- fir.im
- bilibili
- 番剧
- UP 主投稿
+8
View File
@@ -148,6 +148,14 @@ type: 类型,可选参数
参数:platform, 平台类型,必选,1 为 Android,2 为 iOS
### Fir.im 更新
举例: [https://rsshub.app/fir/update/xcz](https://rsshub.app/fir/update/xcz)
路由: `/fir/update/:id`
参数:id, fir app id,必选,如 fir 生成的链接地址为 https://fir.im/xcz,则 id 为 xcz
## bilibili
### 番剧
+3
View File
@@ -412,4 +412,7 @@ router.get('/bugly/changelog/:platform', require('./routes/bugly/changelog'));
// All the Flight Deals
router.get('/atfd/:locations/:nearby?', require('./routes/atfd/index'));
// Fir
router.get('/fir/update/:id', require('./routes/fir/update'));
module.exports = router;
+32
View File
@@ -0,0 +1,32 @@
const axios = require('../../utils/axios');
const config = require('../../config');
module.exports = async (ctx) => {
const id = ctx.params.id;
const APIUrl = `https://download.fir.im/${id}`;
const webUrl = `https://fir.im/${id}`;
const res = await axios({
method: 'get',
url: APIUrl,
headers: {
'User-Agent': config.ua,
Referer: webUrl,
},
});
const data = res.data;
const title = data.app.name + ' 更新';
const item = {};
item.title = data.app.name + ' ' + data.app.releases.master.version + '(' + data.app.releases.master.build + ')';
item.description = data.app.releases.master.changelog;
item.pubDate = new Date(data.app.releases.master.created_at * 1000);
ctx.state.data = {
title: title,
link: webUrl,
item: [item],
};
};