Last active
March 17, 2017 07:00
-
-
Save sorz/6731d31fdee49cdf0a9fc6264d592039 to your computer and use it in GitHub Desktop.
以固定顺序显示 ipn.li 首页的节目列表。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name IPN - Fixed show list on homepage | |
// @namespace org.sorz.lab.ipn | |
// @include https://ipn.li/ | |
// @version 1 | |
// @grant none | |
// @require http://code.jquery.com/jquery-3.2.0.slim.min.js | |
// ==/UserScript== | |
let items = $('.showList > li').toArray(); | |
let link = (i) => $(i).children('a').attr('href'); | |
items.sort((a, b) => link(a) > link(b) ? 1 : -1); | |
$('.showList').empty().append(items); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment