微信客服中心消息提醒

显示视频下载链接

  1. // ==UserScript==
  2. // @name 微信客服中心消息提醒
  3. // @author rjw
  4. // @description 显示视频下载链接
  5. // @namespace com.uestc.rjw
  6. // @icon http://mat1.gtimg.com/www/icon/favicon2.ico
  7. // @license Apache Licence V2
  8. // @encoding utf-8
  9. // @date 20/08/2015
  10. // @modified 20/08/2015
  11. // @include https://mpkf.weixin.qq.com/cgi-bin/kfindex*
  12. // @require http://code.jquery.com/jquery-2.1.1.min.js
  13. // @grant GM_setValue
  14. // @grant GM_getValue
  15. // @grant GM_setClipboard
  16. // @grant GM_notification
  17. // @grant unsafeWindow
  18. // @run-at document-end
  19. // @version 1.0.6
  20. // ==/UserScript==
  21.  
  22.  
  23. /*
  24. * === 说明 ===
  25. *@作者:rjw
  26. *@Email:babyrjw@163.com
  27. * */
  28. unsafeWindow.document.title = "【   】";
  29. var isusing = false;
  30. var newMessageRemind={
  31. _step: 0,
  32. _title: document.title,
  33. _timer: null,
  34. _msg: "NEW",
  35. //显示新消息提示
  36. _show:function(){
  37. newMessageRemind._timer = setTimeout(function() {
  38. newMessageRemind._show();
  39. }, 800);
  40. newMessageRemind._step++;
  41. if (newMessageRemind._step == 3) { newMessageRemind._step = 1;}
  42. if (newMessageRemind._step == 1) { document.title = "【   】" + newMessageRemind._msg;}
  43. if (newMessageRemind._step == 2) { document.title = "【新消息】" + newMessageRemind._msg;}
  44. },
  45. show:function(){
  46. console.log(newMessageRemind._timer);
  47. if(newMessageRemind._timer !== null)return;
  48. newMessageRemind._show();
  49. return [newMessageRemind._timer, newMessageRemind._title];
  50. },
  51. //取消新消息提示
  52. clear: function(){
  53. clearTimeout(newMessageRemind._timer);
  54. newMessageRemind._timer = null;
  55. unsafeWindow.document.title = newMessageRemind._title;
  56. }
  57. };
  58. unsafeWindow.document.onclick=function(event){
  59. event = event || window.event;
  60. var isone ="";
  61. if(!document.all){
  62. isone = event.target.id.toUpperCase();
  63. }
  64. else{
  65. isone = event.srcElement.id.toUpperCase();
  66. }
  67. if(isone!=="TEST"){
  68. isusing = false;
  69. newMessageRemind.clear();
  70. }
  71. };
  72. function playSound(isPlay){
  73. if(isPlay){
  74. audio.play();
  75. }else{
  76. audio.pause();
  77. }
  78. }
  79. var audio = new Audio("http://dx.sc.chinaz.com/Files/DownLoad/sound1/201409/4942.mp3");
  80.  
  81. setInterval(function(){
  82. var number_in = $("span[data-reactid='.0.5.0.0.1.1']");
  83. var number_msg = $("span[data-reactid='.0.5.0.0.0.1']");
  84. var count_in = number_in.text();
  85. var count_msg = number_msg.text();
  86. var msg = "";
  87. if(count_in > 0){
  88. msg = msg + count_in;
  89. msg = msg + "人待接入 ";
  90. }
  91. if(count_msg > 0){
  92. msg = msg + count_msg;
  93. msg = msg + "人待回复 ";
  94. }
  95. if(count_in > 0 || count_msg > 0){
  96. msg = msg + " 赶紧去处理吧";
  97. GM_notification({text:msg, title:"微信客服系统", timeout:30000});
  98. playSound(true);
  99. }else{
  100. playSound(false);
  101. }
  102. },5000);
  103. setInterval(function(){
  104. unsafeWindow.location.reload();
  105. },1800000);

QingJ © 2025

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