Something Awful Friends Highlight

Highlights posts of friends on Something Awful.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Something Awful Friends Highlight
// @namespace    http://mathemaniac.org
// @version      1.0.1
// @description  Highlights posts of friends on Something Awful.
// @match        *://forums.somethingawful.com/usercp.php*
// @match        *://forums.somethingawful.com/showthread.php*
// @copyright    2012-2016, Sebastian Paaske Tørholm
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

var location = "" + document.location;

// Scrape buddy list from user control panel
if (location.match(/usercp\.php/) && $('#buddylist').length) {
    var buddies = [];
    $('#buddylist a[href *= "member.php"]').each(function () {
        buddies.push($(this).attr('title'));
    });

    GM_setValue("buddylist", buddies);
} else {
    var buddies = GM_getValue("buddylist", []);

    $(".post").each( function () {
        console.log("Post: ", this);
        var author = $("dt.author", this);
        if (author && $.inArray(author.first().text(), buddies) >= 0) {
            $("tr td", this).css( {
                "background-color": "lightgreen"
            } );
        }
    } );
}