Jump to content


[0.8.5] User Profiles Web Script

Greasemonkey

  • This topic is locked This topic is locked
32 replies to this topic

Boom_Box #1 Posted Mar 14 2013 - 05:49

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010
Introduction

After a thorough cleansing the following web tool is ready for public consumption.
http://userscripts.o...pts/show/154375

It all started with an RU member's project which has fallen far behind the game releases. It appears the original author has abandoned it. For the past few months I've been quietly cleaning it up for personal use and using the project to get up to speed with javascript.

Description

This tool is a client script that runs in your web browser. It modifies the look of WoT user profile pages by adding statistics, extra info, and pretty much anything that can be derived from the original document. I'm sure all of you know what the normal profile looks like, see spoiler below for how it is enhanced.

It will be maintained for the forseeable future. EU member Orrie has taken a keen interest and has published it over on the EU forums. His version is better suited for EU since it contains a few localized image resources for their web server. My version is designed for NA but either version will support all WoT web servers except for China.

Details

This is a user script, meaning it has to be installed by the user into his/her web browser of choice. It is completely written in JavaScript and is subject to any security restrictions your browser has in place. Modern browsers are very good at sandboxing user scripts and restricting their capabilities so in general it is safe to use scripts. I'd recommend you trust the authors first.

Most of the work performed is on the main profile document. Various values are read to derive new things, tables are modified to add stuff, new tables are added, stats up the kazoo are calculated, and just about every way you can list your tanks is attempted. Other web pages are fetched to get details of the particular profile you are looking at, such as Aliases and Clan History from duckandcover.ru, and NoobMeter PR rating from noobmeter.com. Additionally, medals are derived from the WG API site. Most of the medal images are on the WG web server but a few were stored on a different image host in some cases where WG didn't have unique images available. Other API data is not utilized at the moment, since it is fairly useless. The script does not read or write any local data. Your web browser may cache web page resources however, if that is how you have it set.

Since this script modifies the look and feel of a WG web page I asked them to both review and bless the work. They weren't concerned with IP and as long as nothing malicious was going on then all was good. Not about to risk my account, so feel confident that it is safe. You may review the source code at the link. You may also create your own version and tailor it to your own tastes.

Spoiler                     


What this script is not capable of doing

Some data is simply not available out of game. Mastery badges, spotting damage, etc. Bad API data hinders the ability to calculate stats on a per tank, class, or tier basis. The dossier cache for a vast majority of users is not uploaded to some web server, so pulling data from it is out of the question. Most of it isn't needed anyway. A robust WG API would solve some of these problems and provide a lot more capability.

Install instructions

There are different ways to install scripts, since every browser has their own idea of how the world should work.

With FireFox you need the GreaseMonkey extension installed and enabled, then you can just install the script from the userscripts site.

Opera has a userscipt folder under your user profile. You can simply copy the script file there. My script folder is "C:\Users\******\AppData\Roaming\Opera\Opera\userscripts". Yours will be different.

Chrome is similar to Opera in that it natively supports user scripts. To install from the browser go to Settings -> Extensions, then drag a copy of the user script there. Many people will have trouble with this and an alternative is to install the TamperMonkey extension (very similar to GreaseMonkey).

Browser notes

Some web browsers don't like user scripts. Internet Explorer users are SOL.

Other web browsers use different security models and these impact this script in the following ways:
Opera does not allow cross-domain unless the target server allows it. So, at the moment Opera will not see data from DuckandCover, meaning there will not be Aliases or Clan History listed.

Both Opera and Chrome will expose your wot cookie when fetching API data from the WG web server. Unfortunately, WG decides to reset your web login. You will need to work around this by either ignoring the problem or using a different web browser for profile smurfing.

Update note: a new domain for API data allows FF and Chrome to persist your login. Opera will continue to get reset since it is using the regular WG domain (due to the above cross domain restriction).

AV notes

Most people use anti-virus packages and many of them will balk at user scripts, just because. Generally that is a good thing but it quickly becomes a pain in the butt if you want to get any real work done on the web. You may have to tell your AV to jump off a bridge if you want to install this script.


In closing, hope you enjoy the tool. There are a few planned enhancements along with the possibility of leveraging it for a clan page script.

Edited by Boom_Box, Apr 24 2013 - 23:42.


WarPaint #2 Posted Mar 14 2013 - 07:10

    First lieutenant

  • Players
  • 3724 battles
  • 985
  • Member since:
    04-18-2011
Looks very cool, nice job

Folterknecht #3 Posted Mar 20 2013 - 00:53

    First lieutenant

  • Beta Testers
  • 836 battles
  • 683
  • [LABS] LABS
  • Member since:
    12-29-2010
using it for months now - thx and +1

AMartin223 #4 Posted Mar 25 2013 - 20:19

    Major

  • Players
  • 12351 battles
  • 2,102
  • [T1C] T1C
  • Member since:
    01-18-2012
Looks awesome!  Only one small gripe; there's another script out there that lets you sort the tanks by various counts (battles, tier, victories etc.) and also gives you the differential from server average, and lets you cut out tanks below a specified battle count.  Do you think you could integrate that into your script?  If I try to run both, there's a slight conflict because you do change the tank list a little.  

The script is found here: http://userscripts.o...pts/show/110489, and for now I'm sticking with it.

Engine_95 #5 Posted Mar 25 2013 - 20:29

    Sergeant

  • Beta Testers
  • 22613 battles
  • 242
  • [AR_15] AR_15
  • Member since:
    10-21-2010
Well done Boom_Box!

E-95

Boom_Box #6 Posted Mar 25 2013 - 22:31

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010

View PostAMartin223, on Mar 25 2013 - 20:19, said:

Looks awesome!  Only one small gripe; there's another script out there that lets you sort the tanks by various counts (battles, tier, victories etc.) and also gives you the differential from server average, and lets you cut out tanks below a specified battle count.  Do you think you could integrate that into your script?  If I try to run both, there's a slight conflict because you do change the tank list a little.  

The script is found here: http://userscripts.o...pts/show/110489, and for now I'm sticking with it.

As you're likely aware, running two script versions can cause unexpected results as both scripts are modifying the same page. I've done it many times installing from a different source location (chrome assumes it's a different script in that case).

I plan on re-instating advanced sorting capability much like the original script but not with the original code. Looking into some lightweight table scripts that have all of the bells and whistles, mostly so I won't have to roll my own sorting routines.

Server averages are a sore spot. The original method was an external lookup and manual coding. It was also RU specific. Being such a maintenance heavy endeavor it was the first thing I removed. Getting it back in is on my list of things to do, but not without having a means of doing it automatically for every supported server (or at least a selectable list of servers you can compare against).

Boom_Box #7 Posted Apr 20 2013 - 03:29

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010
Updated with the tank table sorting feature and 8.5 vehicles.

ProBandit #8 Posted Apr 20 2013 - 05:30

    Sergeant

  • Players
  • 27076 battles
  • 116
  • Member since:
    08-21-2011
Hi

I installed script in greasemonkey (FF) wend to my prpofile page on WOT site, and i dont see any difference?
Do i miss anything"? "P)

Tnx

ProBandit #9 Posted Apr 20 2013 - 05:36

    Sergeant

  • Players
  • 27076 battles
  • 116
  • Member since:
    08-21-2011
installed : http://v-k-v.narod.r...ot_stat.user.js

and it works fine


got it!

Edited by GOOROO, Apr 20 2013 - 05:39.


Titan89 #10 Posted Apr 23 2013 - 17:23

    Sergeant

  • Players
  • 33279 battles
  • 204
  • [CLAWS] CLAWS
  • Member since:
    05-06-2011
Hmmm maybe im just dumb... But when ever i use this script as long as i dont look a profile i can stay logged into the website. Soon as i look at a profile it signs me out and i cant log back in period.... Am i doing something wrong? Btw im using Firefox which is up to date.

Boom_Box #11 Posted Apr 23 2013 - 19:19

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010

View PostTitan89, on Apr 23 2013 - 17:23, said:

Hmmm maybe im just dumb... But when ever i use this script as long as i dont look a profile i can stay logged into the website. Soon as i look at a profile it signs me out and i cant log back in period.... Am i doing something wrong? Btw im using Firefox which is up to date.

Go to: http://www.whatsmyuseragent.com/, then post your user agent string here.


I sort of reproduced your error (or what appeared to be) by modifying the user-agent string and fooling the script into thinking I was using a different browser. Then I modified the script to use a better method for identifying the browser type and the problem persisted. Well, I say persisted but fact was I could no longer persist a login to the WG site, even on the home page with the script disabled.

To clear that up I had to do the following:

- In the browser url area entered the following, about:config
- scrolled down to, general.useragent.override, right-clicked and reset that entry
- closed all tabs and firefox
- restarted FF and went into options->privacy->show cookies
- deleted all worldoftanks cookies (there were several of them)
- went to the main portal page and logged in (use "remember me")
- visited other pages and verified login persisted
- enabled the script and looked at my profile, refreshed and verified still logged in

Hope that helps. I'm uploading a new script version that shouldn't be affected by personal user-agent settings.

Edited by Boom_Box, Apr 24 2013 - 06:13.


Titan89 #12 Posted Apr 28 2013 - 09:31

    Sergeant

  • Players
  • 33279 battles
  • 204
  • [CLAWS] CLAWS
  • Member since:
    05-06-2011
Whatever you did or i did seemed to fix it. I can now use this and not have to log in and out and everything else. Thanks for the help and the script!

Boom_Box #13 Posted May 09 2013 - 05:37

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010
Removed SEA from target list. They got a nice little profile redesign, unfortunately my script won't support it.

minifrizzle #14 Posted May 10 2013 - 15:33

    Sergeant

  • Players
  • 203 battles
  • 114
  • Member since:
    12-30-2012
Boom, I'm going through absolute withdrawl after the SEA site redesign.  I'm assuming WG will be rolling the same redesign out to all of their servers eventually.

When will your script be updated to support the new style?

Thanks.

ProBandit #15 Posted May 11 2013 - 01:59

    Sergeant

  • Players
  • 27076 battles
  • 116
  • Member since:
    08-21-2011
I see new version was released yesterday.
I dont have login(cookies) problems any more with FF.

Thanks

Boom_Box #16 Posted May 11 2013 - 02:43

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010

View Postminifrizzle, on May 10 2013 - 15:33, said:

Boom, I'm going through absolute withdrawl after the SEA site redesign.  I'm assuming WG will be rolling the same redesign out to all of their servers eventually.

When will your script be updated to support the new style?

Thanks.

It would take a complete do over on the script, something I'm not looking forward to.

On the bright side, SEA implemented medals and mastery badges. Also, regions pretty much have autonomy as far as web design goes, though I see how WG would prefer a consistent look across regions. So, I expect others to follow suit...meaning I'd be forced to re-script or drop the project. We'll see how it goes.


View PostGOOROO, on May 11 2013 - 01:59, said:

I see new version was released yesterday.
I dont have login(cookies) problems any more with FF.

Thanks

Login resets should no longer be a problem with FF and Chrome. Opera is still FUBAR, luckily there aren't that many Opera users out there.

Folterknecht #17 Posted May 12 2013 - 17:01

    First lieutenant

  • Beta Testers
  • 836 battles
  • 683
  • [LABS] LABS
  • Member since:
    12-29-2010
from SS's-blog 12th may:
...
- the new SEA server statistics system will most likely be applied to other servers too
...

Edited by Folterknecht, May 12 2013 - 17:01.


Boom_Box #18 Posted May 12 2013 - 22:18

    First lieutenant

  • Beta Testers
  • 11751 battles
  • 905
  • [REL-V] REL-V
  • Member since:
    11-17-2010
Started work on a SEA compatible version. Should have something in a few days. Leveraging old code. ripping a lot of stuff out, and converting new tables.

You'll be able to install both scripts, one for old profile and one for the new style. Depending on the domain you're on only one script will execute.

Folterknecht #19 Posted May 12 2013 - 23:03

    First lieutenant

  • Beta Testers
  • 836 battles
  • 683
  • [LABS] LABS
  • Member since:
    12-29-2010

View PostBoom_Box, on May 12 2013 - 22:18, said:

Started work on a SEA compatible version. Should have something in a few days. Leveraging old code. ripping a lot of stuff out, and converting new tables.

You'll be able to install both scripts, one for old profile and one for the new style. Depending on the domain you're on only one script will execute.

thx for helping to fix my stat whoring needs

minifrizzle #20 Posted May 13 2013 - 08:21

    Sergeant

  • Players
  • 203 battles
  • 114
  • Member since:
    12-30-2012
You da man!

So very much looking forward to having those stats back.  Your script provides such a plethora of details on one page straight from the official source that it renders the other stat sites far less useful for quick checks.  Certainly they have their uses for more in-depth analysis (I frequently use vbaddict, mywotstats, and noobmeter) but their pull of official data from WG is not nearly as timely as, well, pulling it directly from WG on their very own website with a healthy heap of useful info added.

You rock.





1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users