Permalink
Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up// ==UserScript== | |
// @name 考试资料网跳转显示答案 | |
// @namespace https://github.com/cuifeiran/ppkao/ | |
// @version 0.1.2 | |
// @description 对单个题目进行跳转,使得跳转后的页面显示题目的答案。期间可能需要验证,遇到问题可以在GitHub issue我~ | |
// @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/* | |
// @include *://www.ppkao.com/daan/* | |
//@contributionURL | |
// @grant none | |
// @downloadURL 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=/"; | |
//获取当前页面URL | |
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 isDaan =new RegExp("daan").test(iSite); | |
var sUrl=""; | |
if (isKaoti===true){sUrl='https://api.ppkao.com/mnkc/kaoti/?id='+ numList;window.location.href =sUrl;} | |
else{ | |
if(isTiku===true){sUrl='https://api.ppkao.com/mnkc/tiku/?id='+ numList;window.location.href =sUrl;} | |
else{ | |
if(isShiti===true){sUrl='https://api.ppkao.com/mnkc/shiti/?id='+ numList;window.location.href =sUrl;} | |
else{ | |
if(isDaan===true){ | |
var html = '<div id="showQRcode" style="position: fixed;right:30px;bottom: 0px;"><a style="font-size: 14px;display:block;color:red;" onclick="$(this).parent().remove();" hidden="javascripe:void(0)" >不想打赏脚本作者,点击此处关闭</a><img width="420" height="210" src="https://s1.ax1x.com/2018/12/11/FJ47an.jpg"></img></div>' | |
var div = document.createElement('div'); | |
div.setAttribute('id', 'showQRcode'); | |
div.innerHTML = html; | |
document.body.appendChild(div); | |
} | |
} | |
} | |
} | |
})(); |