APL Staff PM Notifier

Adds a counter next to staff PM link with open count.

  1. // ==UserScript==
  2. // @name APL Staff PM Notifier
  3. // @namespace https://helifreak.club
  4. // @description Adds a counter next to staff PM link with open count.
  5. // @include https://apollo.rip/index.php
  6. // @include https://apollo.rip/staffpm.php*
  7. // @version 1
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var pmElem;
  13.  
  14. $(document).ready(function() {
  15. pmElem = $("#nav_staffinbox > a")
  16. check();
  17. setInterval(check, 60 * 1000);
  18. });
  19.  
  20. function check() {
  21. $.get("https://apollo.rip/staffpm.php?view=unanswered", function(data) {
  22. var index = data.indexOf("No messages");
  23. if (index === -1) {
  24. var data = $(data);
  25. var count = $(".message_table > tbody > tr", data).length;
  26. pmElem.text("Staff Inbox (" + (count - 1) + ")");
  27. } else {
  28. pmElem.text("Staff Inbox");
  29. }
  30. });
  31. }

QingJ © 2025

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