Jump to content
NeatoMan

script for pulling data off WoTAPI?

Recommended Posts

I'm a newb at this.  Currently, I do it manually by copy/paste accountID's in batches of 100 at a time, copy/paste results into an online JSON converter, and then copy/paste into excel.  This works fine for small samples, but I want to be able to automate it.  Anybody got a script to do this, or can help me set up the process?  All I need are player PR's (global_rating) from their accountID's.    I pick up quickly on this stuff, just never did it before.

many thanks

Link to post
Share on other sites
4 hours ago, Hammam_Boutafant said:

You can write a small program in any language to convert the JSON into CSV, Excel accepts CSV

thanks, but what I really need is a way to automate pulling player PRs off the API.  That's the rate limiting step.

Link to post
Share on other sites
On 8/19/2019 at 7:48 AM, monjardin said:

Do you have a preferred scripting language?

I'm a total newb.  I haven't done any in decades (pascal, basic).  been reading up on python so let's go with that.

Link to post
Share on other sites

I have a list of account ID's from a bunch of battles in one column in excel.  For each ID I am trying to get their PR rating.  Can this be done strictly within excel (i.e. query WoT's API by referencing one cell at a time?)

Link to post
Share on other sites
On 8/25/2019 at 5:52 PM, NeatoMan said:

I have a list of account ID's from a bunch of battles in one column in excel.  For each ID I am trying to get their PR rating.  Can this be done strictly within excel (i.e. query WoT's API by referencing one cell at a time?)

Yes. You should be able to do that directly in Excel with a VBA script. 

Link to post
Share on other sites

Could you suggest any links where one can go to learn how to do this?   I have no clue where to start, or even what terms to put into a google search.  Seems like it should be a very easy task to accomplish, I just have no idea where to start.

remember I'm a total newb at this. 

Link to post
Share on other sites

I would do this if I were you. Convert the excel file into .csv. Parse it using any programming language (Java, C, Python, C#...anyone you please) and then program a simple application that read the id, send a request to WG API for the PR and saves that data into an array or write it ni the same momento using buffering

Link to post
Share on other sites

I would do that if I knew how.  Don't know the syntax or what is even possible.

I can concatenate each account ID into a url that would return a result from the API.   I have no idea how to automate that list of urls to return a list of results, or even if that's how I should proceed, or the proper syntax, etc.

Something that is so simple logically is obviously not so simple to someone who has never programmed this stuff before.

Link to post
Share on other sites

if its for a limited list like a clan or something similar sized, Google sheets and Excel both can concatenate URLs and pull requests. I think  i have an old example of the cell logic laying around in my google drive. 

edit: I lied. We did the cheap workaround and just pulled the data off Wotlabs. Every time you open the page it refreshes the Wotlabs sig call. Here's the cell logic if you want it (or want to try to adapt it for the API) 
=image("http://wotlabs.,.,.,.,.,net/sig_cust/FFFFFF/000000/na/7d/30d/1000g/"&B3&"/signature.png",3)

(where B3 is the cell with the players ingame name. I broke it so it isnt trying to run as an active link) 

and 30 sec on google revealed this:

http://forum.worldoftanks.eu/index.php?/topic/352845-sample-code-for-using-the-api/

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...