Jump to content
BocajSretep

UserScript to add stats to Official Forums

Recommended Posts

Hello everyone,

 

I wrote a quick userscript to add WoTLabs signature images to the official forums. It only works for NA currently, but I'll add support for other regions later if there is any desire for it.

 

No need to copypaste names, now you can measure e-peens and sort out if someone is bad or just stupid with ease.

 

I recommend greasemonkey on Firefox and tampermonkey on Chrome.

 

Without further ado, here is the script

// ==UserScript==
// @name        Statify Official WoT Forums
// @namespace   BocajSretep
// @description Adds WoTLabs stats to the official forums
// @include     http://forum.worldoftanks.com/*
// @version     1.1
// @grant       none
// ==/UserScript==
(function statifyWotForums() {
    var poasts = document.querySelectorAll('.post_block'),
        fragment = document.createDocumentFragment(),
        listItem = document.createElement('li'),
        imgDiv = document.createElement('div'),
        statsSig = document.createElement('img'),
        cssRules = document.createElement('style'),
        playerName;
    
    cssRules.innerHTML = '.wotLabsStats{width: 107px; padding: 2px; margin-top: 5px; background: white; border: 1px solid grey; overflow-x: hidden; transition: width 500ms}.wotLabsStats:hover{width: 472px}';
    document.head.appendChild(cssRules);
    
    
    listItem.classList.add('desc');
    listItem.classList.add('stats');
    
    imgDiv.classList.add('wotLabsStats');
    
    imgDiv.appendChild(statsSig);
    listItem.appendChild(imgDiv);
    fragment.appendChild(listItem);
    
    for(var i = 0; i < poasts.length; ++i) {
        playerName = poasts[i].querySelector('.name').getAttribute('hovercard-id');
        
        statsSig.src = "http://wotlabs.net/sig/na/" + playerName + "/signature.png"
        
        poasts[i].querySelector('.basic_info').appendChild(fragment.cloneNode(true));
        
    }
})();

You can also find it on Greasy Fork: http://greasyfork.org/scripts/5363-statify-official-wot-forums

Link to post
Share on other sites

https://github.com/icy12ice/world_of_tanks_forum_statter/blob/master/NA%20Server/NA_wot_sig_script_tampermonkey.js

icy12ice made something like this. I don't know much about coding but his shows stats the same way that the wotlabs forums do.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...