kufirc大图

kufirc大图浏览

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name kufirc大图
  3. // @namespace kufirc
  4. // @version 0.1.3
  5. // @description kufirc大图浏览
  6. // @author Afan
  7. // @match https://kufirc.com/torrents.php*
  8. // @match https://kufirc.com/top10.php
  9. // @grant GM_xmlhttpRequest
  10. // @require https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. var torrents = function torrentlist(){
  17. $('tr.torrent').each(function(){
  18. //console.log($(this).children('td')[1]);
  19. //var scriptTag = $($($(this).children('td')[1]).children('script')[0]);
  20. $(this).find('td script').each(function(){
  21. var pattern = /src=([^>]+)>/;
  22. console.log($(this).html().match(pattern)[1])
  23. var imgsrc = $(this).html().match(pattern)[1].replace(/\\"/g, '').replace(/\/\//g,'/').replace(/(?!:)\\\//g,'/');
  24. //console.log(imgsrc);
  25. $(this).after('<td><img src="'+imgsrc+'" style="max-width:700px;height:auto;"></td>');
  26. });
  27. });
  28. };
  29. torrents();
  30. })();