Report thread spammers

Adds button to report thread and user.

  1. // ==UserScript==
  2. // @name Report thread spammers
  3. // @namespace pxgamer
  4. // @version 0.4
  5. // @description Adds button to report thread and user.
  6. // @author pxgamer
  7. // @include *kat.cr/community/show/*
  8. // @require https://greasyfork.org/scripts/19550-get-user-hash/code/Get%20User%20Hash.js?version=124786
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. $('a.ka.ka16.ka-report.ka-red[title="Report thread"]').after(' <a class="ka ka16 ka-report reportSpammer" style="background: #8B0000;" title="Report thread spammer"></a>');
  16. var threadRep = $('#report_thread_div form').attr('action');
  17. var username = $('div[id^="post"]:first .commentbody div.userPicSize100px .badge .badgeInfo .badgeUsernamejs a.plain[href^="/user/"]').text();
  18. var userHash = guh(username);
  19.  
  20. $('.reportSpammer').on('click', function() {
  21. // Report thread
  22. $.ajax({
  23. type: "POST",
  24. url: threadRep,
  25. data: { reason: "Thread Spammer" }
  26. });
  27.  
  28. // Report user
  29. $.ajax({
  30. type: "POST",
  31. url: "/account/report/"+userHash+"/",
  32. data: { reason: "Thread Spammer" }
  33. });
  34.  
  35. //Refresh to complete.
  36. location.refresh();
  37. });
  38.  
  39. })();