Skip to content

Instantly share code, notes, and snippets.

@aliifam
Created March 31, 2022 16:19
Show Gist options
  • Select an option

  • Save aliifam/b12f7128f564ebe7e6517ac05861c7d4 to your computer and use it in GitHub Desktop.

Select an option

Save aliifam/b12f7128f564ebe7e6517ac05861c7d4 to your computer and use it in GitHub Desktop.
fetch method to get totqal applause count in one page using applause-button.com
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: #fcbe24;
font-size: 200px;
background-color: #18222d;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<h1 id="header"></h1>
<script>
try {
fetch('https://api.applause-button.com/get-claps?url=https://notes.aliif.space/awal-mula-masuk-goa-suci/', {
method: "GET",
headers: {"Referer": "robot"}
})
.then(response => response.text())
.then(text => document.getElementById('header').innerHTML = text);
}
catch(err) {
document.getElementById('header').innerHTML = 0;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment