Advertisement
Guest User

Untitled

a guest
Oct 17th, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         meneame.mostrarUsuariosNegativos
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1
  5. // @match        https://www.meneame.net/*/voters
  6. // @icon https://mnmstatic.net/v_149/favicon-32x32.png
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.     function showUserNeg(){
  12.         var votos = $(".voters-list");
  13.         votos.find(".item").filter(function(){
  14.             return $(this).find("span").length
  15.         }).each(function(){
  16.             let elto = $(this);
  17.             let span = elto.find("span");
  18.  
  19.             let user = elto.find("a").attr("href").split("/user/")[1];
  20.             let voto = span.text();
  21.             span.text(user+" ("+voto+")");
  22.         });
  23.     }
  24.  
  25.  
  26.     // Crea una instancia de observer
  27.     var observer = new MutationObserver(function(mutations) {
  28.         mutations.forEach(function(mutation) {
  29.             showUserNeg()
  30.         });
  31.     });
  32.     observer.observe($("#voters-container")[0], {childList: true});
  33.     showUserNeg();
  34. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement