反恰客脚本

try to take over the world!

目前為 2019-08-21 提交的版本,檢視 最新版本

// ==UserScript==
// @name         反恰客脚本
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://quan.ithome.com/0/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if ($(".postcontent").html().indexOf("class=\"appmore\"") > 0) {
  var _id = location.href.substring(location.href.indexOf("/0/") + 3, location.href.indexOf("/0/") + 6) + location.href.substring(location.href.indexOf("/0/") + 7, location.href.indexOf("/0/") + 10);
  $.ajax({
    url: "https://ithome.fxxkcar.com/getithomepost.php?id=" + _id,
    dataType: 'jsonp',
    jsonp: "CallBack",
    success: function (data) {
      var _content=data.content;

      _content=replaceimg(_content,data.imgs);
      $(".postcontent").html(_content);
    }
  })

}

function replaceimg(content,imgsArr){
  var _rexArray=content.match(/<!--IMG_(\S\S)|(\S)-->/g);
  for(var _i=0;_i<_rexArray.length;_i++){
    content=content.replace(_rexArray[_i]+"->","<img src='"+imgsArr[_i]+"'/>");
  }
  return content;
}
})();

QingJ © 2025

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