A JavaScript class library suitable for the analysis of GenShin's wish records
适用与原神祈愿记录分析的JavaScript类库
此类库适用与 NodeJS
和React Native
已在React Native
中通过测试, NodeJS
未测试
Such libraries are suitable for NodeJS
and React Native
Tested in React Native
, NodeJS
not tested
要启动并运行本地副本,请遵循这些简单的示例步骤。
To get a local copy up and running follow these simple example steps.
复制GenShinWishAnalysis.js
文件到你的项目
-
复制
GenShinWishAnalysis.js
文件到你的项目 -
安装
node-fetch
npm install node-fetch
-
在
GenShinWishAnalysis.js
的开头加上import fetch from 'node-fetch';
关于函数的作用, 请查看GenShinWishAnalysis.js
文件中的注释
For the role of the function, please see the comments in the GenShinWishAnalysis.js
file
例子:
const url = " https://webstatic.mihoyo.com/hk4e/event/e20190909gacha-v2/index.html?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const GSWA = new GenShinWishAnalysis(url);
GSWA.getLog(GSWA.type[0]).then(res => {
GSWA.analysisData(res).then(res => {
console.log(res);
});
});
返回:
{
total: 235,
rank_total: {3: 202, 4: 30, 5: 3},
rank5_count: [
{name: "纳西妲", count: 59, time: "2022-11-05 08:41:04"},
{name: "甘雨", count: 77, time: "2022-09-11 13:41:33"},
{name: "七七", count: 30, time: "2022-09-04 13:32:52"}
]
}
Distributed under the MIT License. See LICENSE
for more information.