您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
combines multi-page Cracked.com articles into a single page.
// ==UserScript== // @name CrackedPageOne // @namespace digital-utopia.org // @version 0.3 // @description combines multi-page Cracked.com articles into a single page. // @match http://www.cracked.com/* // @copyright 2014, Digital_Utopia // @grant unsafeWindow // ==/UserScript== var $ = unsafeWindow.jQuery; var pages=[]; //$.noConflict(); $( document ).ready(function() { var ps = parseInt($(".paginationNumber:eq(0)").html()); var pe = parseInt($(".paginationNumber:eq(1)").html()); var doHtml =false; $(".paginationNumber:eq(1)").html("1"); if(ps==1 && pe > 1) { var pathname = window.location.pathname; if(pathname.indexOf("_p1")!=-1) { pathname=pathname.substring(1,pathname.length-2); }else if(pathname.indexOf("html")!=-1){ pathname=pathname.substring(1,pathname.length-5)+"_p"; doHtml=true; }else{ pathname=pathname.substring(1,pathname.length-1)+"_p"; } for(var i=(ps+1); i <= pe;i++) { if(doHtml==false) { pages.push("http://www.cracked.com/"+pathname+i+"/"); }else{ pages.push("http://www.cracked.com/"+pathname+i+".html"); console.log("http://www.cracked.com/"+pathname+i+".html"); } } loadPage(0); } function loadPage(index) { $.get(pages[index],function(data){ var content=($(".body > section",data).html()); var doWrap=false; if(content == undefined) { content=($(".articleWrapper",data).html()); doWrap=true; } if(doWrap==false){ $(".body > section:eq(0)").append(content); }else{ $(".articleWrapper").append(content); } $("img",".body > section:eq(0)").each(function(){ $(this).attr("src",$(this).attr("data-img")); }); if(pages[index+1]!=undefined) { loadPage(index+1); } }); } $(".next").removeAttr("href") $(".next").attr("class",$(".next").attr("class")+" disabled"); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址