Guest User

blocking that faggot spammer

a guest
May 25th, 2014
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Funner Post Blocker 3
  3. // @version 1.0
  4. // @require http://code.jquery.com/jquery-2.0.3.min.js
  5. // @description Block that user...with style.
  6. // @author: Steve5451
  7. // ==/UserScript==
  8.  
  9. // Let's set some variables. \\
  10. var blockeduser = 'BETELGEUSE SUCKS COCKS'; // The exact name of the user you wish to block.
  11. var usernamereplace = 'Blocked'; // What their name with be replaced with in quotes. Leave empty to disable.
  12. var blockedtext = '~Blocked~'; // What their post will be replaced with. Leave empty to disable.
  13. var avatarurl = 'http://i.imgur.com/aYYikg0.png'; // What their avatar will be replaced with. Leave empty to disable.
  14.  
  15. if(document.URL.indexOf("?topic=") !=-1) {
  16. $('.windowbg').each(function(i) {
  17. checkuser($(this));
  18. });
  19. $('.windowbg2').each(function(i) {
  20. checkuser($(this));
  21. });
  22. }
  23.  
  24. function checkuser(window) {
  25. window.find('a').each(function(i) {
  26. if($(this).parent().attr('class') == "quoteheader") {
  27. var quote_txt = $(this).html();
  28. var name_end = quote_txt.indexOf(' on ', 0);
  29. var name = quote_txt.substring(12,name_end)
  30. if(name == blockeduser) {
  31. if(blockedtext != '') {
  32. $(this).parent().next().html(blockedtext);
  33. }
  34. if(usernamereplace != '') {
  35. $(this).parent().html(usernamereplace);
  36. }
  37. }
  38. }
  39. if($(this).html() == blockeduser) {
  40. if(avatarurl != '') {
  41. $(this).parent().parent().find('.avatar').attr('src', avatarurl);
  42. }
  43. if(blockedtext != '') {
  44. $(this).parent().parent().parent().find('.post').html(blockedtext);
  45. }
  46. if(usernamereplace != '') {
  47. $(this).replaceWith(usernamereplace);
  48. }
  49. }
  50. });
  51. }
Advertisement
Add Comment
Please, Sign In to add comment