mirror of
https://github.com/catmpeg/catmpeg.github.io.git
synced 2026-02-20 15:50:57 +03:00
привет сасет
This commit is contained in:
parent
cde3115249
commit
109a24432f
2 changed files with 12 additions and 17 deletions
11
assets/lastplayed.js
Normal file
11
assets/lastplayed.js
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
const lastPlayedBlock = document.getElementById('last-played');
|
||||||
|
let xmlHttp = new XMLHttpRequest();
|
||||||
|
xmlHttp.open("GET", "https://lastfm-last-played.biancarosa.com.br/catmpeg/latest-song", false);
|
||||||
|
xmlHttp.send(null);
|
||||||
|
if (xmlHttp.responseText != 0) {
|
||||||
|
const lastParse = JSON.parse(xmlHttp.responseText);
|
||||||
|
|
||||||
|
const lastPlayed = document.querySelector("#song");
|
||||||
|
lastPlayed.innerHTML = "<a target=\"blank_\" href=\"" + lastParse["track"]["url"] + "\">" + lastParse["track"]["name"] + " - " + lastParse["track"]["artist"]["#text"] + "</a>";
|
||||||
|
lastPlayedBlock.style.display = "block";
|
||||||
|
}
|
||||||
18
index.html
18
index.html
|
|
@ -30,23 +30,7 @@
|
||||||
<h2>Latest played song:</h2>
|
<h2>Latest played song:</h2>
|
||||||
<h3 id="song"></h3>
|
<h3 id="song"></h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- <script>let u='catmpeg',s=document.querySelector('#song');fetch('https://lastfm-last-played.biancarosa.com.br/'+u+'/latest-song').then(r=>r.json()).then(j=>s.innerHTML=`<a href="https://www.last.fm/music/${encodeURIComponent(j.track.artist['#text']).replace(/%20/g,'+')}/_/${encodeURIComponent(j.track.name).replace(/%20/g,'+')}" target="_blank">${j.track.name} - ${j.track.artist['#text']}</a>`);</script> -->
|
<script src="assets/lastplayed.js"></script>
|
||||||
<script>
|
|
||||||
const lastPlayedBlock = document.getElementById('last-played');
|
|
||||||
|
|
||||||
let xmlHttp = new XMLHttpRequest();
|
|
||||||
xmlHttp.open("GET", "https://lastfm-last-played.biancarosa.com.br/catmpeg/latest-song", false);
|
|
||||||
xmlHttp.send(null);
|
|
||||||
|
|
||||||
if (xmlHttp.responseText != 0) {
|
|
||||||
const lastParse = JSON.parse(xmlHttp.responseText);
|
|
||||||
|
|
||||||
const lastPlayed = document.querySelector("#song");
|
|
||||||
lastPlayed.innerHTML = "<a target=\"blank_\" href=\"" + lastParse["track"]["url"] + "\">" + lastParse["track"]["name"] + " - " + lastParse["track"]["artist"]["#text"] + "</a>";
|
|
||||||
|
|
||||||
lastPlayedBlock.style.display = "block";
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</main>
|
</main>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
<h3><a href="//retro.cat.tolya1337.ru">> retro page <</a></h3>
|
<h3><a href="//retro.cat.tolya1337.ru">> retro page <</a></h3>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue