Show Profiler in forum

Tool to go to the profiler of a user from that user's comments in the forum

当前为 2017-09-03 提交的版本,查看 最新版本

// ==UserScript==
// @name         Show Profiler in forum
// @version      0.1
// @description  Tool to go to the profiler of a user from that user's comments in the forum
// @author       A Meaty Alt
// @include      /fairview\.deadfrontier\.com\/onlinezombiemmo\/index\.php\?topic=/
// @grant        none
// @namespace https://greasyfork.org/users/150647
// ==/UserScript==

(function() {
    'use strict';
    var commonLink = "http://www.dfprofiler.com/profile/view/";
    function appendProfilerLink(container){
        var userId = container.innerHTML.match(/u=(.*?)"/)[1];
        var link = document.createElement("a");
        link.href = commonLink + userId;
        var img = document.createElement("img");
        img.src = "http://www.dfprofiler.com/images/favicon-32x32.png"; //git gud hotrods c:
        link.appendChild(img);
        container.appendChild(link);
    }
    var dst = $("div[class='smalltext']"); //just even numbers
    for(var i=0; i<dst.length; i+=2){
        appendProfilerLink(dst[i]);
    }
})();