1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
let friends = ['aaa', 'bbb', 'ccc'];

let x;

$('#replurked_plurks_tab_btn').parent().clone().each(function(i) {
    $(this).find('a').attr('id', 'friends').html('<i class="pif-like"></i>朋友的訊息<span id="count_favorite_plurks"></span>')
}).prependTo('#filter_tab');

$("#friends").click(function() {
    x = setInterval(function() {
        $('.plurk.cboxAnchor').each(function() {
            let userId = $(this).find('.p_img a').attr('href');
            userId = userId.replace(/^\//g, '');
            if (friends.indexOf(userId) === -1) $(this).css('display', 'none');
        });
    }, 500);
});

$('.off_tab, .filter_selected.bottom_line_bg').click(function() {
    if ($(this).attr('id') !== 'friends') clearInterval(x);
})