Skip to content

Commit

Permalink
Update online.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Fullperm Alpha authored Sep 23, 2024
1 parent bc847d3 commit a30d23c
Showing 1 changed file with 17 additions and 39 deletions.
56 changes: 17 additions & 39 deletions online.html
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>

0 comments on commit a30d23c

Please sign in to comment.