钉钉关键字消息查询

根据关键字的查询匹配的消息并打开

  1. // ==UserScript==
  2. // @name 钉钉关键字消息查询
  3. // @namespace http://sherry.cf/
  4. // @version 1.0
  5. // @description 根据关键字的查询匹配的消息并打开
  6. // @author Sherry
  7. // @match https://im.dingtalk.com/*
  8. // ==/UserScript==
  9. /// jQuery
  10. // @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
  11. (function() {
  12. 'use strict';
  13. var html = `
  14. <div style="position: absolute;top:60px;left: 400px; color:#fff;height:40px;width:220px;padding:10px;">
  15. <input type="text" placeholder="输入关键字" id="link-keyword"/><input type="button" value="开启" id="link-search-btn"/>
  16. <input type="button" value="关闭" id="link-search-close" style="display:none;float:right"/>
  17. </div>
  18. <script>
  19. var openNewNoticeTimer;
  20.  
  21. $("#link-search-btn").click(function(){
  22. var keyword=$("#link-keyword").val();
  23. $("#link-search-btn").hide();
  24. $("#link-search-close").show();
  25.  
  26. openNewNoticeTimer= setInterval(function(){
  27. $(".latest-msg").each(function(){
  28. if ($(this).text().indexOf(keyword) != -1 ){
  29. console.log($(this).text());
  30. $(this).css("border","1px solid red");
  31. $(this).click();
  32. }
  33. });
  34. },1000);
  35. $("#link-search-close").click(function(){
  36. clearInterval(openNewNoticeTimer);
  37. })
  38. });
  39.  
  40. $("#link-search-close").click(function(){
  41. $("#link-search-btn").show();
  42. $("#link-search-close").hide();
  43. $(".latest-msg").css("border","none");
  44. clearInterval(openNewNoticeTimer);
  45. });
  46. </script>
  47. `;
  48. $('body').append(html);
  49. })();

QingJ © 2025

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