Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
jkamkk authored Nov 8, 2023
1 parent 8e5bb86 commit 8d43f82
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<html>
<head>
<script>
// 这个变量存放了你的仓库的API地址,你可以根据你的仓库名和用户名修改
var repoAPI = "https://api.github.com/repos/jkamkk/mp3/contents/";
Expand Down Expand Up @@ -44,9 +42,13 @@
return arr[index];
}

// 这个函数用来重定向到一个随机的mp3文件的URL
function redirectToMp3() {
getMp3s(repoAPI).then(function(mp3s) {
var mp3 = randomChoice(mp3s);
}).catch(function(error) {
console.error(error);
});
}
redirectToMp3();
</script>
</head>
<body>
<div id="mp3"></div>
</body>
</html>

0 comments on commit 8d43f82

Please sign in to comment.