// ==UserScript==
// @name bangumi 是否互为好友
// @namespace http://tampermonkey.net/
// @version 0.5
// @description 在各个地方的头像旁显示是否互为好友 #请不要打开学姐楼#
// @author 鈴宮華緋
// @include /https?:\/\/(bgm\.tv|bangumi\.tv|chii\.in)\/user\/.*\/(rev_)?friends/
// @downloadURL none
// ==/UserScript==
(function() {
function main() {
function get_id_list(url) {
let list = [];
$.ajax({
url : url,
async : false,
success: function(data) {
let match = data.match(/
= 0 ; i--) {
if (!users_a.eq(i).html().match(/pic\/user/)) {
// users_a.splice(i, 1);
continue;
}
let user_a = users_a.eq(i);
let id = null;
if (!(id = user_a.attr("href").match(/\/user\/.*/))) {
continue;
}
id = id[0];
let eachother = true;
friends_id_list.indexOf(id) === -1 ? eachother = false : 0;
rev_friends_id_list.indexOf(id) === -1 ? eachother = false : 0;
let box = null;
if (user_a.find("span.userImage").length > 0) {
box = user_a.find("span.userImage");
} else if (user_a.find("span.avatarNeue").length > 0){
box = user_a.find("span.avatarNeue");
}
if (box) {
let size = box.width() / 4;
box.css("position", "relative");
let span = $("");
span.css({
"position" : "absolute",
"bottom" : "-2px",
"right" : "-5px",
"font-size" : size + "px"
});
eachother ? span.text("😀") : span.text("");
box.append(span);
}
}
}
window.setTimeout(function() {
main();
}, 0);
// window.setTimeout(function() {
// let i = 10000000000;
// while(i > 0) {
// i--;
// }
// }, 0);
})();