sehuatang

直接把帖子列表转成图片浏览,点击图片可以进入帖子.

Od 08.03.2024.. Pogledajte najnovija verzija.

  1. // ==UserScript==
  2. // @name sehuatang
  3. // @description 直接把帖子列表转成图片浏览,点击图片可以进入帖子.
  4. // @version 1.0.6
  5. // @author armyant
  6. // @namespace https://sleazyfork.org/zh-CN/scripts/489232-sehuatang
  7. // @include https://www.sehuatang.net/forum-*
  8. // @include *://*.sehuatang.org/*
  9. // @include *://*.sehuatang.net/*
  10. // @include *://*.5aylp.com/*
  11. // @include *://*.jq2t4.com/*
  12. // @include *://*.www.0krgb.com/*
  13. // @include *://*.1qyqs.app/*
  14. // @include *://*.ds5hk.app/*
  15. // @match *://*.sehuatang.net/*
  16. // @match *://*.sehuatang.org/*
  17. // @match *://*.sehuatang.*/*
  18. // @match *://*.jq2t4.com/*
  19. // @match *://*.0krgb.com/*
  20. // @match *://*.xxjsnc.co/*
  21. // @match *://*.o4vag.com/*
  22. // @match *://*.weterytrtrr.*/*
  23. // @match *://*.qweqwtret.*/*
  24. // @match *://*.retreytryuyt.*/*
  25. // @match *://*.qwerwrrt.*/*
  26. // @match *://*.ds5hk.app/*
  27. // @match *://*.30fjp.com/*
  28. // @match *://*.18stm.cn/*
  29. // @match *://*.xo6c5.com/*
  30. // @match *://*.mzjvl.com/*
  31. // @match *://*.9xr2.app/*
  32. // @match *://*.kzs1w.com/*
  33. // @match *://*.nwurc.com/*
  34. // @match *://*.zbkz6.app/*
  35. // @match *://*.ql75t.cn/*
  36. // @match *://*.0uzb0.app/*
  37. // @match *://*.d2wpb.com/*
  38. // @match *://*.5aylp.com/*
  39. // @match *://*.8otvk.app/*
  40. // @include https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&page=*
  41. // @require https://code.jquery.com/jquery-3.4.1.min.js
  42. // @grant GM_xmlhttpRequest
  43. // @license GNU GPLv3
  44. // ==/UserScript==
  45. $(document).ready(function () {
  46. $("tbody[id*='normalthread']").each(function () {
  47. // 获取当前域名 https://www.sehuatang.net/forum-95-9.html www.sehuatang.net
  48. // let urls = "https://www.sehuatang.net/";
  49. let urls = `https://${document.domain}/`;
  50. // 获取详情页地址
  51. urls += $(this).find(".icn a").attr("href");
  52. // 删除所有子元素
  53. // $(this).children().remove()
  54. $(this).find(".tps").remove()
  55. // 标记当前节点
  56. let icn_td = $(this);
  57. console.log(urls);
  58. let href = document.location.href;
  59.  
  60. GM_xmlhttpRequest({
  61. method: "GET",
  62. url: urls,
  63. headers: {
  64. "User-agent": window.navigator.userAgent,
  65. Accept:
  66. "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
  67. cookie: document.cookie,
  68. referer: href,
  69. },
  70. onerror: function (e) {
  71. console.log(e);
  72. },
  73. onload: function (result) {
  74. let doc = result.responseText;
  75. // console.log(doc);
  76.  
  77. // 获取标题
  78. let title = $(doc).find("#thread_subject").html();
  79. // console.log(title);
  80.  
  81. let temp_imges = [];
  82. // 获取所有的图片
  83. $.each($(doc).find(".zoom"), function (index, value) {
  84. let temp_image_url = $(value).attr("file");
  85. if (temp_image_url == undefined || temp_image_url.toString().indexOf("static") > -1) {
  86. // return 实现continue功能
  87. // return false 实现break功能
  88. return;
  89. }
  90. temp_imges.push(temp_image_url);
  91. });
  92. // console.log(temp_imges)
  93.  
  94. // 获取ed2k
  95. let magnet = [];
  96. $.each($(doc).find(".blockcode li"), function (index, value) {
  97. let temp_magnet = $(value).text();
  98. magnet.push(temp_magnet)
  99. });
  100. // console.log(magnet);
  101.  
  102. let temp_html = "";
  103. // temp_html += `<tr><td colspan="5" style="font-weight: bold;font-size: 15px"><a href="${urls}">${title}</a> </td></tr>`;
  104.  
  105. temp_html += `<tr><td width="100%" colspan="5">`
  106. for (let i = 0; i < temp_imges.length; i++) {
  107. if (i >= 8) {
  108. break;
  109. }
  110. temp_html += `<img src="${temp_imges[i]}" height="150" style="margin: 2px;"/>`
  111. }
  112. temp_html += `</td></tr>`
  113.  
  114. temp_html += `<tr><td width="100%" colspan="5" style="border-bottom: blueviolet 4px solid">`
  115. temp_html += `
  116. <div class="blockcode" style="padding: 5px 0 5px 20px;border: 1px solid #CCC;background: #F7F7F7 url(/static/image/common/codebg.gif) repeat-y 0 0;overflow: hidden;">
  117. <div id="code_BN2" style="padding-left: 20px">
  118. <ol>`;
  119. for (const temp_magnet of magnet) {
  120. temp_html += `<li style="list-style-type:decimal-leading-zero;font-family:Monaco,Consolas,'Lucida Console','Courier New',serif;font-size:12px;line-height:1.8em">
  121. <div style="padding-left: 20px">${temp_magnet}</div>
  122. </li>`
  123. }
  124. temp_html += `</ol></div><div style="padding-left: 40px"><em onclick="let temp_magnet_str_01='${magnet.toString().replace(/(\n|\r|\r\n|↵)/g, '')}';setCopy(temp_magnet_str_01.replace(/(,)/g, '\\r\\n'), '复制成功');return false;">复制代码</em></div></div>`
  125. temp_html += `</td></tr>`
  126. // temp_html += `<script type="application/javascript">code_BN2_1=magnet;</script>`;
  127. // temp_html += `<tr><td colspan="5" style="background: blue"></td></tr>`;
  128.  
  129. $(icn_td).append(temp_html);
  130. },
  131. });
  132. });
  133. });