WeMeStrongShare

微密圈快速分享【强制分享】

  1. // ==UserScript==
  2. // @name WeMeStrongShare
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description 微密圈快速分享【强制分享】
  6. // @author PWNINT32
  7. // @match https://web.weme.fun/*
  8. // @icon https://www.google.com/s2/favicons?domain=weme.link
  9. // @require https://unpkg.com/ajax-hook@2.0.3/dist/ajaxhook.min.js
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13. function GetBodyJson(_body)// Convert body to json
  14. {
  15. var _BodyObj = {};
  16. var _BodyArray = _body.split("&");
  17. _BodyArray.forEach((item)=>{item = item.trim().split("=");_BodyObj[item[0]]= item[1]})
  18. return _BodyObj;
  19. }
  20. function InjectIndex()
  21. {
  22. if(location.href.includes("Login"))
  23. {
  24. var QR = document.querySelector("body > div > div.main > div.title > h4 > a:nth-child(3)");
  25. QR.href="#";
  26. var WECHAT = document.querySelector("body > div > div.main > div.more-login > a:nth-child(1)");
  27. WECHAT.href = "#";
  28. }
  29. }
  30. function LoadingDebugInfo()//加载调试信息
  31. {
  32. console.warn("[*] 调试信息:脚本加载成功...");
  33. console.warn("[*] --------------------------");
  34. console.warn("[*] 欢迎使用本脚本:\n1.本脚本需要搭配工具使用,用于解析付费\VIP帖子\n 2.欢迎加入讨论圈:8390463,每日更新图包");
  35. console.warn("[*] --------------------------");
  36. }
  37. function GetJsonCookie()
  38. {
  39. var CookieJar = document.cookie.split(";");
  40. var ReturnJson = {};
  41. CookieJar.forEach((item)=>
  42. {
  43. var Result = item.trim().split("=");
  44. ReturnJson[Result[0]] = Result[1];
  45. });
  46. return ReturnJson;
  47. }
  48. function AddExtraInfo(CommunityUid)//为圈子主页添加额外按钮
  49. {
  50. var MainBar = document.querySelector("body > div.container.body-content > div.main > div.community > div.right > div.right-bottom > div.community-detail > span.action-button");
  51. MainBar.innerHTML = '<span id="Extra_Uid">点击获取当前圈子的UID</span> <span id="GetCookie">点击获取登陆用户Cookie</span>'
  52. var CookieSpan = document.querySelector("#GetCookie");
  53. var GetUid = document.querySelector("#Extra_Uid");
  54. GetUid.onclick = ()=>{alert(`当前圈子的UID为:${CommunityUid}`)};
  55. CookieSpan.onclick = ()=>{
  56. if(GetJsonCookie()["ASP.NET_SessionId"]!=undefined)
  57. {
  58. alert(`您的Cookie为:${GetJsonCookie()["ASP.NET_SessionId"]}`);
  59. }
  60. else
  61. {
  62. alert("浏览器没有取消HttpOnly属性,无法获取登陆Cookie,请安装Cookie Manager解除HttpOnly限制后重试");
  63. }
  64. }
  65. }
  66. function GetFullCommunityPost()//更改请求参数获取单个用户全部帖子链接
  67. {
  68. InjectIndex();
  69. ah.proxy({
  70. onRequest: (config, handler) => {
  71. handler.next(config);//固定写法
  72. },
  73. onError: (err, handler) => {
  74. handler.next(err)
  75. },
  76. onResponse: (response, handler) => {
  77. handler.next(response);
  78. Change2ShareButton();//等待网页响应完毕后再进行调用
  79. if(response.config.url.includes("ShareArticle"))
  80. {
  81. var ShortLink = JSON.parse(response.response)["data"]["WxUrl"];//获取分享短链
  82. CloseShareWindowAndGetShareLink(ShortLink);
  83. console.log("[*] 短链获取成功,内容为"+ShortLink);
  84. }
  85. else if(response.config.url.includes("GetCommunityInfo"))
  86. {
  87. var CommUid = pageObj.data.CommunityInfo.community.Id;
  88. AddExtraInfo(CommUid);
  89. }
  90. }
  91. })
  92. }
  93. function Change2ShareButton()
  94. {
  95. var Action_ItemClass = document.getElementsByClassName("action-item");
  96. var Action_ItemClass_Count = Action_ItemClass.length;
  97. for(var Index=0;Index<Action_ItemClass_Count;Index++)
  98. {
  99. var DataEventNum_Ban = "30";
  100. var DataEventNum_Share = "5";
  101. var CurrentButton_Type = Action_ItemClass[Index].getAttribute("data-event");
  102. if(CurrentButton_Type==DataEventNum_Ban)
  103. {
  104. Action_ItemClass[Index].setAttribute("data-event","5");
  105. Action_ItemClass[Index].textContent="获取分享链接";
  106. }
  107. }
  108. }
  109. function CloseShareWindowAndGetShareLink(ShareLinkText)//关闭分享成功弹窗,并获取短链内容
  110. {
  111. var CloseButton = document.getElementById("btn-close");
  112. if(CloseButton!=undefined)
  113. {
  114. CloseButton.click()
  115. var SearchBox = document.evaluate('/html/body/nav/div/div[1]/form/input',document).iterateNext();
  116. SearchBox.value = ShareLinkText;//将短链移入到搜索框中
  117. SearchBox.select();
  118. document.execCommand('copy');
  119. var PostInputBox = document.evaluate('/html/body/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/textarea',document).iterateNext();
  120. PostInputBox.value = "链接已复制到剪贴板中,请直接在软件中粘贴!";
  121.  
  122. }
  123. }
  124. GetFullCommunityPost();

QingJ © 2025

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