fixed CORS, added non-affiliation and added DATES!!!

This commit is contained in:
zyqunix 2024-12-03 18:28:05 +01:00
parent 2c7f7d62e2
commit 6f05307f95
3 changed files with 8 additions and 4 deletions

View file

@ -1,4 +1,4 @@
fetch('https://corsproxy.io/?https%3A%2F%2Fusers2.smartgb.com%2Fg%2Fg.php%3Fa%3Ds%26i%3Dg26-39906-27') fetch('https://api.allorigins.win/raw?url=https%3A%2F%2Fusers2.smartgb.com%2Fg%2Fg.php%3Fa%3Ds%26i%3Dg26-39906-27')
.then(response => response.text()) .then(response => response.text())
.then(html => { .then(html => {
let parser = new DOMParser(); let parser = new DOMParser();
@ -6,8 +6,8 @@ fetch('https://corsproxy.io/?https%3A%2F%2Fusers2.smartgb.com%2Fg%2Fg.php%3Fa%3D
let entries = doc.querySelectorAll('table[bgcolor="#F4F4F4"]'); let entries = doc.querySelectorAll('table[bgcolor="#F4F4F4"]');
entries.forEach(entry => { entries.forEach(entry => {
let dateElement = entry.querySelector('tr > td > font > b'); let dateElement = entry.querySelector('tr > td > font');
let date = dateElement && dateElement.textContent.includes('Date:') ? dateElement.textContent.replace('Date:', '').trim() : 'No date'; let date = dateElement.parentNode.nextSibling.textContent.trim();
let name = entry.querySelector('tr:nth-child(2) td:nth-child(2)') ? entry.querySelector('tr:nth-child(2) td:nth-child(2)').textContent.trim() : 'No name'; let name = entry.querySelector('tr:nth-child(2) td:nth-child(2)') ? entry.querySelector('tr:nth-child(2) td:nth-child(2)').textContent.trim() : 'No name';
let email = entry.querySelector('tr:nth-child(3) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(3) td:nth-child(2) a').textContent.trim() : 'No email'; let email = entry.querySelector('tr:nth-child(3) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(3) td:nth-child(2) a').textContent.trim() : 'No email';
let web = entry.querySelector('tr:nth-child(4) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(4) td:nth-child(2) a').textContent.trim() : 'No website'; let web = entry.querySelector('tr:nth-child(4) td:nth-child(2) a') ? entry.querySelector('tr:nth-child(4) td:nth-child(2) a').textContent.trim() : 'No website';

View file

@ -10,7 +10,7 @@
</head> </head>
<body> <body>
<h1>Guestbook from <a href="https://users2.smartgb.com/g/g.php?a=s&i=g26-39906-27">SmartGB</a></h1> <h1>Guestbook from <a href="https://users2.smartgb.com/g/g.php?a=s&i=g26-39906-27">SmartGB</a> <h6>(fentseller.lol is not affiliated with SmartGB)</h6> </h1>
<div id="guestbook-container"></div> <div id="guestbook-container"></div>
<div id="error"></div> <div id="error"></div>

View file

@ -8,6 +8,10 @@
src: url('/Fonts/JetBrainsMono/JetBrainsMono-Regular.woff2'); src: url('/Fonts/JetBrainsMono/JetBrainsMono-Regular.woff2');
} }
h6 {
margin-top: -10px;
}
body { body {
background-color: #505050; background-color: #505050;
font-family: 'Hack', 'JetBrainsMono', monospace; font-family: 'Hack', 'JetBrainsMono', monospace;