Greasy Fork

Greasy Fork is available in English.

考试资料网跳转显示答案

对单个题目进行跳转,使得跳转后的页面显示题目的答案。期间可能需要验证

目前为 2018-12-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         考试资料网跳转显示答案
// @namespace https://github.com/cuifeiran/ppkao/
// @version      0.1.2
// @description  对单个题目进行跳转,使得跳转后的页面显示题目的答案。期间可能需要验证
// @author       Dave
// @match        *://www.ppkao.com/tiku/shiti/*
// @match        *://www.ppkao.com/kaoti/*
// @include      *://www.ppkao.com/tiku/shiti/*
// @include      *://www.ppkao.com/shiti/*
// @include      *://www.ppkao.com/kaoti/*
//@exclude       *://www.ppkao.com/kaoti/daan/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
//清除限制题目访问数量的cookie
 var Days = 30;
 var exp = new Date();
 exp.setTime(exp.getTime() + Days*24*60*60*1000);
 document.cookie="PPKAO=PPKAOSTID=&PPKAOCEID=&PPKAOSJID=&UserName=&EDays=; domain=ppkao.com;expires="+exp.toGMTString()+";path=/";
 var iSite = window.location.href;
 var reg = /[1-9][0-9]*/g; 
 var numList = iSite.match(reg);   
 var isKaoti =new RegExp("kaoti").test(iSite);
 var isTiku =new RegExp("tiku").test(iSite);
 var isShiti =new RegExp("shiti").test(iSite);
 var sUrl="";
 if (isKaoti===true){sUrl='https://api.ppkao.com/mnkc/kaoti/?id='+ numList;}
 else
  {
    if(isTiku===true){sUrl='https://api.ppkao.com/mnkc/tiku/?id='+ numList;}
    else{
          if(isShiti===true){sUrl='https://api.ppkao.com/mnkc/shiti/?id='+ numList;}
        }
      
  }     
 window.location.href =sUrl;
})();