EM deathsound

Adds button to profiles to listen to deathsound

  1. // ==UserScript==
  2. // @name EM deathsound
  3. // @version 1.0
  4. // @description Adds button to profiles to listen to deathsound
  5. // @author Whitepimp007
  6. // @match https://epicmafia.com/user/*
  7. // @match https://epicmafia.com/u/*
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/105745
  10. // ==/UserScript==
  11.  
  12.  
  13. var profileLink = document.getElementsByClassName("lcontrols sel")[0].children[0].href;
  14. var profileNumber = profileLink.replace("https://epicmafia.com/user/","");
  15. console.log(profileNumber);
  16.  
  17. var deathSoundLink = "https://epicmafia.com/uploads/deathsounds/" + profileNumber + ".ogg";
  18.  
  19. var userbox = document.getElementById("finduserbox");
  20.  
  21. var constructSpan=document.createElement("span");
  22. constructSpan.className="lcontrols";
  23.  
  24. var constructAnchor=document.createElement("a");
  25. constructAnchor.href=deathSoundLink;
  26.  
  27. var constructI=document.createElement("i");
  28. constructI.className="icon-music";
  29. constructI.innterHTML="::before";
  30.  
  31. constructAnchor.appendChild(constructI);
  32. constructSpan.appendChild(constructAnchor);
  33. userbox.appendChild(constructSpan);