-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fullperm Alpha
authored
Sep 23, 2024
1 parent
bc847d3
commit a30d23c
Showing
1 changed file
with
17 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Online Count</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
background-color: #f0f0f0; | ||
} | ||
#count { | ||
font-size: 2em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="count">Loading...</div> | ||
<script> | ||
const proxyUrl = 'https://cors-anywhere.herokuapp.com/'; | ||
const targetUrl = 'https://www.bonniebots.com/homepage.txt'; | ||
|
||
<script> | ||
fetch('https://www.bonniebots.com/homepage.txt') | ||
.then(response => response.text()) | ||
.then(data => { | ||
const lines = data.split('\n'); | ||
const lastLine = lines[lines.length - 1].trim(); | ||
const parts = lastLine.split(' '); | ||
const count = parts[1]; // The second part should be the number | ||
document.getElementById('count').textContent = `Online: ${count}`; | ||
}) | ||
.catch(error => { | ||
document.getElementById('count').textContent = 'Error loading data'; | ||
console.error('Error fetching data:', error); | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
fetch(proxyUrl + targetUrl) | ||
.then(response => response.text()) | ||
.then(data => { | ||
const lines = data.split('\n'); | ||
const lastLine = lines[lines.length - 1].trim(); | ||
const parts = lastLine.split(' '); | ||
const count = parts[1]; // The second part should be the number | ||
document.getElementById('count').textContent = `People online: ${count}`; | ||
}) | ||
.catch(error => { | ||
document.getElementById('count').textContent = 'Error loading data'; | ||
console.error('Error fetching data:', error); | ||
}); | ||
</script> |