sehuatang

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

  1. // ==UserScript==
  2. // @name sehuatang
  3. // @description 直接把帖子列表转成图片浏览,点击图片可以进入帖子.
  4. // @version 0.0.4
  5. // @author bluebabes
  6. // @namespace https://www.sehuatang.net/forum-103-1.html
  7. // @include https://www.sehuatang.net/forum-*
  8. // @include https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&page=*
  9. // @require https://code.jquery.com/jquery-3.4.1.min.js
  10. // @grant GM_xmlhttpRequest
  11. // @license GNU GPLv3
  12. // ==/UserScript==
  13. $(document).ready(function () {
  14. $(".icn").each(function () {
  15. var urls = "https://www.sehuatang.net/";
  16. urls += $(this).find("a").attr("href");
  17. var imgg = $(this).find("img");
  18. var icn_td = $(this);
  19. console.log(urls);
  20.  
  21. var href = document.location.href;
  22.  
  23. GM_xmlhttpRequest({
  24. method: "GET",
  25. url: urls,
  26. headers: {
  27. "User-agent": window.navigator.userAgent,
  28. Accept:
  29. "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",
  30. cookie: document.cookie,
  31. referer: href,
  32. },
  33. onerror: function (e) {
  34. console.log(e);
  35. },
  36. onload: function (result) {
  37. var doc = result.responseText;
  38. console.log(doc);
  39. var img01 = $(doc).find(".zoom").attr("file");
  40. $(imgg).attr("src", img01);
  41. var dvi01 = $(doc).find(".blockcode");
  42. var dvi02 = $(doc).find("#thread_subject");
  43. //console.log($(dvi02).html());
  44. var magnet = $(dvi01).find("li").text();
  45. //console.log(magnet);
  46. $(icn_td).css("width", "100%");
  47. $(icn_td).append(
  48. "<p style='margin-top: 20px;font-size: 2em;'>" +
  49. $(dvi02).html() +
  50. "</p><br/>"
  51. );
  52. $(icn_td).append(
  53. "<p style='margin-top: 20px;font-size: 2em;'>" + magnet + "</p><br/>"
  54. );
  55. },
  56. });
  57. });
  58. $(".common").each(function () {
  59. $(this).remove();
  60. });
  61. $(".by").each(function () {
  62. $(this).remove();
  63. });
  64. $(".num").each(function () {
  65. $(this).remove();
  66. });
  67. });