Greasy Fork is available in English.

Eliminar Shouts Texto

Elimina los shouts de solo texto

  1. // ==UserScript==
  2. // @name Eliminar Shouts Texto
  3. // @namespace http://taringa.net/rata__7
  4. // @version 0.3
  5. // @description Elimina los shouts de solo texto
  6. // @author Nezumi
  7. // @include *://www.taringa.net/*
  8. // @exclude *://www.taringa.net/*/mi/*
  9. // @exclude /.*:\/\/www.taringa\.net\/.*\/[0-9]+/
  10.  
  11. // ==/UserScript==
  12.  
  13. ;(function ($, window) {
  14. var intervals = {};
  15. var removeListener = function(selector) {
  16. if (intervals[selector]) {
  17. window.clearInterval(intervals[selector]);
  18. intervals[selector] = null;
  19. }
  20. };
  21. var found = 'waitUntilExists.found';
  22. $.fn.waitUntilExists = function(handler, shouldRunHandlerOnce, isChild) {
  23. var selector = this.selector;
  24. var $this = $(selector);
  25. var $elements = $this.not(function() { return $(this).data(found); });
  26. if (handler === 'remove') {
  27. // Hijack and remove interval immediately if the code requests
  28. removeListener(selector);
  29. } else {
  30. // Run the handler on all found elements and mark as found
  31. $elements.each(handler).data(found, true);
  32. if (shouldRunHandlerOnce && $this.length) {
  33. // Element was found, implying the handler already ran for all
  34. // matched elements
  35. removeListener(selector);
  36. } else if (!isChild) {
  37. // If this is a recurring search or if the target has not yet been
  38. // found, create an interval to continue searching for the target
  39. intervals[selector] = window.setInterval(function () {
  40. $this.waitUntilExists(handler, shouldRunHandlerOnce, true);
  41. }, 250);
  42. }
  43. }
  44. return $this;
  45. };
  46. }(jQuery, window));
  47.  
  48. //Acá empieza mi código
  49. var eliminarTexto = function(){
  50. $(".activity-element.shout").waitUntilExists(function(){
  51. $(".activity-element.shout").remove();
  52. });
  53. $(".shout-main-content.none").waitUntilExists(function(){
  54. $(".shout-main-content.none").parent().remove();
  55. });
  56. };
  57.  
  58. eliminarTexto();