mirror of
https://github.com/jbowdre/lolz.git
synced 2024-11-23 21:42:17 +00:00
now: retrieve latest track/album added to musicthread
This commit is contained in:
parent
a4a96dae3d
commit
2b25bc9c32
2 changed files with 13 additions and 4 deletions
4
now.md
4
now.md
|
@ -40,7 +40,7 @@
|
|||
- [Futuristic Violence and Fancy Suits](https://johndiesattheend.com/futuristic-violence-fancy-suits/) by Jason Pargin (aka David Wong) {book}
|
||||
- [The Gentleman](https://imdb.com/title/tt13210838/) {display}
|
||||
- [Baldur's Gate 3](https://store.steampowered.com/app/1086940/Baldurs_Gate_3/) {gamepad}
|
||||
- [Homicide (feat. Eminem)](https://musicthread.app/link/2fWfoHJysUL8LlwyiIZoo6Vjmck) by Logic {headphones}
|
||||
- <span id="now-playing">Silence</span> {headphones}
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -61,4 +61,4 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -121,5 +121,14 @@ fetch(wx_endpoint)
|
|||
document.getElementsByClassName('fa-arrow-right-long')[0].classList = CLASS_MAP_PRESS[pressureTrend];
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
// retrieves latest link from a musicthread thread and displays it on the page
|
||||
const musicthread = 'https://musicthread.app/api/v0/thread/2aVjZUocjk96LELFbV5JvJjm14v';
|
||||
fetch(musicthread)
|
||||
.then(res => res.json())
|
||||
.then(function(res){
|
||||
let nowPlaying = res.links[0];
|
||||
document.getElementById('now-playing').innerHTML = "<a href='" + nowPlaying.page_url + "'>" + nowPlaying.title + "</a> by " + nowPlaying.artist;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue