(wish it was written in ts :sob:)
all you really need is two files.
demo: https://thinliquid.github.io/pmoring/example.html.
check out example.html
and pmoring.config.js
its that simple.
item
: The current item in the listprev
: The previous item in the listnext
: The next item in the listindex
: The current index of the item in the listrandom
: A random item in the listlist
: The entire list
This is just a basic example, which gets ListenBrainz data
<span>
Last listened on ListenBrainz:
{(async () => {
const { payload: data } = await (await fetch('https://api.listenbrainz.org/1/user/' + item.username + '/listens?count=1')).json()
return "<a href='https://musicbrainz.org/recording/" + data.listens[0].track_metadata.mbid_mapping.recording_mbid + "'>" + data.listens[0].track_metadata.track_name + " - " + data.listens[0].track_metadata.artist_name + "</a>"
})()}
</span>
Note: you must change the import URL of the config file in
pmoring.js