mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-21 08:32:16 +08:00
d82847f541
* style: prefer object shorthand syntax * refactor: prefer Array#map over Array#forEach * style: prefer arrow callback * chore(eslint): update rules * style: auto fix by eslint
32 lines
870 B
JavaScript
32 lines
870 B
JavaScript
const got = require('@/utils/got');
|
|
|
|
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 got({
|
|
method: 'get',
|
|
url: APIUrl,
|
|
headers: {
|
|
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.link = `https://fir.im/x9zu?release_id=${data.app.releases.master.id}`;
|
|
item.pubDate = new Date(data.app.releases.master.created_at * 1000).toUTCString();
|
|
ctx.state.data = {
|
|
title,
|
|
link: webUrl,
|
|
item: [item],
|
|
};
|
|
};
|