xxdavid / lastfm-friends-who-listen

:notes: Get the Friends Who Listen widget back on Last.fm
https://goo.gl/w3DxOr
MIT License
25 stars 3 forks source link

(Idea) Add last played track to badges at /following page #10

Open myfonj opened 6 years ago

myfonj commented 6 years ago

Visiting https://www.last.fm/user/…/following currently displays quite dumb list of friends (I like this therm better as well). I suppose it could be viable for this extension to enrich them by "last played" or other info that is accessible, in (pseudo-)realtime manner.

As an example, here is a quick'n'dirty console / bookmarklet-ish proof-of-concept scraping information from /library pages:

document.querySelectorAll('.user-list-link').forEach(l=>{fetch(l.href+'/library').then(r=>r.text()).then(t=>(new DOMParser()).parseFromString(t,"text/html")).then(d=>{l.parentNode.appendChild(d.querySelector('.chartlist-name')).style.display='block';l.parentNode.appendChild(d.querySelector('.chartlist-timestamp>*')).style.display='block'}).catch(e=>console.error(e))})

producing after

from original before.

xxdavid commented 6 years ago

Hey, yep, this might be useful. Unfortunately, I don't think I have time to implement it now, although it doesn't look hard to do. However, you are free to implement it yourself and if you want it to be part of this extension, just send a PR and I'll merge it.