ReadKanquwen

对看趣闻网站的文章进行阅读标记的脚本,目前只有简体标记

// ==UserScript==
// @name         ReadKanquwen
// @namespace    http://ReadKanquwen.JMNSY/
// @version      0.1
// @description  对看趣闻网站的文章进行阅读标记的脚本,目前只有简体标记
// @match        http://kanquwen.com/*
// @license      MIT
// @copyright    2015.7.25, JMNSY
// ==/UserScript==
$().ready(function(){
    var link = window.location.href;
    if(/\/\d{1,}\//.test(link)){
        var id_temp = link.match(/\/\d{1,}\//)[0];
        var id = id_temp.substring(1,id_temp.length - 1);
        var arr = window.localStorage.getItem("postid") == null?{}:JSON.parse(window.localStorage.getItem("postid"));
        if(arr[id] == null){
            arr[id] = true;
            window.localStorage.setItem("postid",JSON.stringify(arr));
        }
    }
    var postid = window.localStorage.getItem("postid") == null?{}:JSON.parse(window.localStorage.getItem("postid"));
    $(".post_title").each(function(){
        var temp = $(this);
        var postindex_temp = temp.children(":first").attr("href").match(/\/\d{1,}\//)[0];
        var postindex = postindex_temp.substring(1,postindex_temp.length - 1);
        if(postid[postindex] && !/com\/\d{1,}\//.test(link)){
            var img1 = new Image();
            img1.className="read";
            img1.src="data:image/gif;base64,R0lGODlhswChANUsAP8AAPgcHPgdHfgXF/8zM/gYGPgZGfgWFvgbG/gaGvlQUP9mZvlMTPlNTflKSvcXF/uCgv+ZmfkcHPuAgPlJSflOTvkaGvcWFvkbG/cYGPccHPcbG/lPT/uBgfcaGvt/f/pPT/pMTPt9fflLS/pOTvt+fvkXF/pKSvp/f/t8fPuDg/kdHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACwALAAAAACzAKEAAAb/QJZwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/oLCDNbruPBMDiTa+fNeuIfc/nLgAAG32DhFMHgIiFiosscixzehGIAHqMln0AcUSTl518gENxiAsEBJ6nZIClQ6oADZOJc6izXbBCorC5a7S8V7igL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0qkMuyzPFztUZUvrtWanB3OolsqtkCQpj61U9r7jxR/IU/+MwuouFvUnDZovJG2jHmIXcjoI20iLpdtnryuHiV75dpK5W7YtfZ2qXPvx9Yw1fV+CRQhYjhoRGQAsMYLDC9bm02c6B+1dWYdypwanFsNlUCACAAEzAgSnBhpf4qCKgAMTzfWQH4aqbeTj2vw/ubz8WAIFCwlhBC/iujCV54XKo8MdCyu+QdRw3aYATySA1q4K1NIeP3LjB4nQrOZnSLyjrhKhW+CEpuYFiL68lxymS5bc+bGadZFkA0ZMgAhz3lCu3GVMBvm6bZ6dkWMRZCTCZc/z23AUbd3WgfyJeQhigVEL3lSgHJo/vhKVnR8+OGgDVsHgtnb1smAB5DOb0jFbNZL5Bi3rECzt1Bj2izZeoUtWytYgflQFrBU53E7X2oTjgmeBcOxAl2PQ1h8OxGWGncNPGtrCIk91pKTMbktJ6dh2qfF5pl+FN1i6pnbPN7W57+9tBAAA7";
            temp.next().children(":first").before(img1);
        }
    });
    $(".read").css("float","right").css("z-index","999").css("width","13%").css("length","13%");
    $(".meta").append("<div style='clear:right'>");
});
//如果需要清除阅读痕迹,请在控制台执行下面这句
//localStorage.clear();