天天看點

Tampermonkey CSDN按時間先後,排序使用者專欄博文

// ==UserScript==
// @name         Clean Csdn
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       zcy
// @match        https://*blog.csdn.net/*
// @grant        none
// @require    http://code.jquery.com/jquery-1.11.0.min.js
// ==/UserScript==

$(document).ready(function(){
    var keyArray=[];
    var _ul=$(".column_article_list");
    var li_Children=_ul.children().remove();
    var time2ele=new Map;
    $.each(li_Children, function(idx, ele){
        var time=$($($(ele).children("a:last-child")).children("div:last-child")).children("span:first-child").text().trim();
        time2ele.set(time,ele);
        keyArray.push(time);
    });
    keyArray.sort();
    $.each(keyArray,function(index,value){
        _ul.append(time2ele.get(value));
    });
});