Skip to content

Instantly share code, notes, and snippets.

@g8up
Last active December 19, 2016 15:00
Show Gist options
  • Save g8up/07c9d20b592ff0e3fbe19711b28ef2ae to your computer and use it in GitHub Desktop.
Save g8up/07c9d20b592ff0e3fbe19711b28ef2ae to your computer and use it in GitHub Desktop.
熊猫找福利 V1.0.0
javascript: void((function () {
/**
* 熊猫找福利 V1.0.1
* 日期:2016-12-19 22:59:24
* 用途:让熊猫 TV 房间列表页面按在线人数降序排列
* 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX)。
*/
if (window.location.host.indexOf('panda') < 0) {
window.location.href = 'http://www.panda.tv/cate/lol';
}
var containers = $('.video-list');
containers.each( function( index, item ){
$container = $(item);
var rooms = $container.find('li.video-list-item');
function getNum(room) {
return Number($(room).find('.video-number').text());
}
rooms.sort(function (room1, room2) {
return getNum(room2) - getNum(room1);
});
$container.html(rooms);
$container.css({
opacity: 0
}).animate({
opacity: 1
});
});
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment