typo: 修改引入示例的源码目录章节名称

This commit is contained in:
100gle
2022-04-21 15:51:49 +08:00
parent cb660ece9a
commit dfed750d9a
3 changed files with 0 additions and 0 deletions

25
code/01/fetchVideoStat.js Normal file
View File

@@ -0,0 +1,25 @@
(function () {
let api = window.__INITIAL_STATE__;
let stat = undefined;
try {
stat = api.videoData.stat;
} catch (e) {}
const cols = ["rank", "like", "coin", "collect", "share"];
let blankStat = {};
for (const col of cols) {
blankStat[col] = "";
}
if (stat === undefined) {
return blankStat;
}
return {
rank: stat.his_rank,
like: stat.like,
coin: stat.coin,
collect: stat.favorite,
share: stat.share,
};
})();