博客园总算支持Markdown了

等了好久,终于支持Markdown了!


试试部分特性:http://tt-0411.cnblogs.com

// ==UserScript==
// @name       yunpan-qun
// @version    0.1
// @include    http://qun*.yunpan.360.cn/group/index*
// @run-at document-end
// ==/UserScript==

(function(){ 
    var ypsi = function(){
        var post = function(url, gid){
            var req = new XMLHttpRequest();
            req.onreadystatechange = function(){
                if(req.readyState == 4){
                    // console.log(req.responseText);
                    var o = JSON.parse(req.responseText);
                    var text = gid + "\t" + o["errmsg"];
                    var size = o["data"] ? o["data"]["size"] : null;
                    if(size) text += "\t" + (size / 1024 / 1024);
                    console.log(text);
                }
            }
            req.open("POST", url, true);
            req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            req.send("gid=" + gid)
        };
        
        var lastday = GM_getValue("yunpan-lastday", "");
        var today = (new Date()).format("YYYYMMdd");
        GM_setValue("yunpan-lastday", today);
        if(lastday && lastday == today ){
            console.log("Today signed.");
        } else {
            var groups = document.querySelectorAll("#groupPanel .group-item");
            [].forEach.call(groups, function(e){
                var gid = e.dataset["gid"];
                post("/group/signIn", gid);
            });
        }
        console.log("done");
    };
    setTimeout(ypsi, 3000);
})();
posted @ 2014-03-04 12:16  tt-0411  阅读(1717)  评论(2编辑  收藏  举报