Check Reddit Modqueue

Checks your modqueue.

  1. // ==UserScript==
  2. // @name Check Reddit Modqueue
  3. // @version 1.04
  4. // @namespace http://ictinus.com/crmq/
  5. // @description Checks your modqueue.
  6. // @match http://*.reddit.com/*
  7. // @match https://*.reddit.com/*
  8. // ==/UserScript==
  9.  
  10. // Author: Ictinus
  11. // Released: 14 October 2011
  12. // Update: 21 Oct 2011, v1.02, fixed execution in Firefox. Thanks to TedFromTheFuture.
  13. // Update: 11 Jan 2011, v1.03, fixed icon display after reddit style changes.
  14.  
  15. // Author: Nanashi
  16. // Fix: 08 Sep 2021, v1.04, updated for new_modmail, new spritesheet.
  17.  
  18. var redditModqChecker = {
  19. version : 1.03,
  20. init: function() {
  21. var aMail = document.getElementById("new_modmail");
  22. var spanCheckmq = document.createElement('span');
  23. spanCheckmq.id = "modqChecker";
  24. spanCheckmq.innerHTML = "";
  25. spanCheckmq.style.cursor = "pointer";
  26. spanCheckmq.href = "#";
  27. aMail.parentNode.insertBefore(spanCheckmq, aMail.nextSibling);
  28. redditModqChecker.update();
  29. },
  30. addGlobalStyle : function(css) {
  31. var head, style;
  32. head = document.getElementsByTagName('head')[0];
  33. if (!head) { return; }
  34. style = document.createElement('style');
  35. style.type = 'text/css';
  36. style.innerHTML = css;
  37. head.appendChild(style);
  38. },
  39. update: function() {
  40. xhr = new XMLHttpRequest();
  41. xhr.open("GET","/r/mod/about/modqueue.json", true);
  42. xhr.onreadystatechange = function () {
  43. redditModqChecker.display();
  44. };
  45. xhr.send();
  46. },
  47. display: function() {
  48. var modqChecker = document.getElementById("modqChecker");
  49. if(xhr.readyState == 4) {
  50. if(xhr.status == 200) {
  51. var response=xhr.responseText;
  52. var unreadJSON = JSON.parse(response);
  53. if (unreadJSON.data.children.length == 0) {
  54. modqChecker.innerHTML = "";
  55. } else {
  56. modqChecker.innerHTML = "<span class='separator'>|</span><a class='rmc-spam' href='/r/mod/about/modqueue'>&nbsp;</a><span>" + unreadJSON.data.children.length + "</span>";
  57. }
  58. } else {
  59. modqChecker.innerHTML = "<span class='separator'>|</span><a class='rmc-spam' href='/r/mod/about/modqueue'>¿</a>";
  60. }
  61. }
  62. }
  63. }
  64.  
  65. if (document.body) {
  66. redditModqChecker.addGlobalStyle('a.rmc-spam {background-image:url(https://www.redditstatic.com/sprite-reddit.png); background-position:-22px -1633px; width: 18px; height: 14px; overflow:hidden; top:-2px; margin-bottom: -6px; margin-right:2px; display: inline-block; position:relative; } span#modqChecker {font-weight:bold; color: #369;}');
  67. redditModqChecker.init();
  68. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址