made the code leak my api key a bit less. also fixed deadnaming

This commit is contained in:
Juli 2024-06-03 15:22:04 +00:00
parent 4ce3870f2f
commit b0eeea1791
3 changed files with 27 additions and 7 deletions

25
yons_crazybox/fmproxy.php Normal file
View file

@ -0,0 +1,25 @@
<?php
// URL to fetch the recent tracks
$url = 'https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=fake_yon&format=json&limit=1&api_key=f27b0fc77baba3236a3876f57446d679';
// Initialize a cURL session
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
// Return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute the session and store the result
$response = curl_exec($ch);
// Close the cURL session
curl_close($ch);
// Set the header to return JSON content
header('Content-Type: application/json');
// Output the response
echo $response;
?>

View file

@ -1 +1 @@
<meta http-equiv="refresh" content="0; URL=/lexis_crazybox/thesilly.html"" />
<meta http-equiv="refresh" content="0; URL=thesilly.html"" />

View file

@ -165,12 +165,7 @@ window.addEventListener('load', function() {
})
$apiKey = "f27b0fc77baba3236a3876f57446d679";
$apiRoot = "http://ws.audioscrobbler.com/2.0/";
$username = "fake_yon";
// URL to make the request to
$url = "https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=fake_yon&format=json&limit=1&api_key=f27b0fc77baba3236a3876f57446d679";
$url = "/yons_crazybox/fmproxy.php";
function fetchRecentTrack() {
console.log("Update")
fetch($url)