mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-01 17:48:15 +08:00
35 lines
952 B
JavaScript
35 lines
952 B
JavaScript
const got = require('@/utils/got');
|
|
|
|
module.exports = async (ctx) => {
|
|
const url = 'https://launchermeta.mojang.com/mc/game/version_manifest.json';
|
|
|
|
const response = await got({
|
|
method: 'get',
|
|
url,
|
|
});
|
|
|
|
const typeMap = {
|
|
release: '正式版',
|
|
snapshot: '快照',
|
|
old_alpha: '过时的预览版',
|
|
old_beta: '过时的测试版',
|
|
};
|
|
|
|
const data = response.data.versions;
|
|
|
|
const title = `Minecraft Java版游戏更新`;
|
|
|
|
ctx.state.data = {
|
|
title,
|
|
link: `https://www.minecraft.net/`,
|
|
description: title,
|
|
item: data.map((item) => ({
|
|
title: `${item.id} ${typeMap[item.type] || ''}更新`,
|
|
description: `${item.id} ${typeMap[item.type] || ''}更新`,
|
|
pubDate: new Date(item.releaseTime).toUTCString(),
|
|
link: `https://www.minecraft.net`,
|
|
guid: item.id + item.type,
|
|
})),
|
|
};
|
|
};
|