Last.fm User Levels

Add Last.fm User Level ( http://stas.sh/lastfm/ ) to every last.fm profile you visit.

当前为 2017-04-03 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Last.fm User Levels
  3. // @namespace https://github.com/Row/lastfm-userscripts
  4. // @description Add Last.fm User Level ( http://stas.sh/lastfm/ ) to every last.fm profile you visit.
  5. // @version 1.1
  6. // @include https://www.last.fm/user/*
  7. // @include https://www.lastfm.*/user/*
  8. // @include https://cn.last.fm/user/*
  9. // ==/UserScript==
  10.  
  11. var insertPoint = document.querySelector('.col-sidebar');
  12.  
  13. if(insertPoint) {
  14. var imgUrl = 'http://stas.sh/lastfm/pic.php?username=';
  15. var link = document.createElement('a');
  16. var userName = document.querySelector('.avatar').getAttribute('alt');
  17. link.setAttribute('href', 'http://stas.sh/lastfm/');
  18. link.innerHTML = '<img src="' + imgUrl + userName + '" style="margin-left: -331px; position: absolute;" />'
  19. insertPoint.insertBefore(link, insertPoint.firstChild);
  20. }