Jump to content

PW Stats Download


Eumirbago
 Share

Recommended Posts

We wanna be able to download stats of everything.

 

Alliance Stats:

 - Members

 - Score

 - Avg. Score

 - Beige/Gray

 - Treasures

 - Infra

 - GDP

 - All Military

 

Nation Stats:

 - # of Cities

 - Total Military

 - Score

 - Infra

 - Infra Destroyed

 

Update twice a day I guess?

 

ilu Sheepy

Edited by Eumirbago
  • Upvote 4
Lxr4VfE.png

Link to comment
Share on other sites

  • Administrators

You are aware that this information is available in the APIs, correct? While it doesn't output a file that you can download, you can easily grab the info. For example:

 

Alliance: https://politicsandwar.com/api/alliance/id=831

 

Nation: https://politicsandwar.com/api/nation/id=10838

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

You are aware that this information is available in the APIs, correct? While it doesn't output a file that you can download, you can easily grab the info. For example:

 

Alliance: https://politicsandwar.com/api/alliance/id=831

 

Nation: https://politicsandwar.com/api/nation/id=10838

 

On the Alliance API, could you put a list of Nation IDs in the alliance?

I will take responsibility for what I have done, if I must fall, I will rise each time a better man.

 

 

Link to comment
Share on other sites

On the Alliance API, could you put a list of Nation IDs in the alliance?

 

This would be very helpful and would save from having to scrape the info from the main site.

  • Upvote 1

[22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made

 

BK in a nutshell

Link to comment
Share on other sites

Alliance Stats:

 - Members

 - Score

 - Avg. Score

 - Beige/Gray

 - Treasures

 - Infra

 - GDP

 - All Military

I've requested this like, three times. It'd still be really nice to have game-provided downloadable stats that are updated every day at ~12:00 amserver time. Until then, I have to either work through the alliance stat pulls of others or (more often) wake up at 3 AM each night to grab APR stats. :v
  • Upvote 1
xzhPlEh.png?1

Link to comment
Share on other sites

  • 2 weeks later...

A daily csv dump of stats would be very helpful. That way anyone could pull them down and quickly do analytics. This kind of thing is critical for alliance management. It would allow us to easily create reports, identify members who need help or evaluate the success of econ programs.

 

Or better yet could we have a public facing url with a complete table of this information that uses a simple structured xpath or html table (like the city management screen)? That way we could develop our own 3rd party analytics dashboards linked directly to it.

 

The most useful tables would be:

Nation Stats

City Stats (with ruler name, nation name, and nation ID)

War Stats (same info as above, with a flag for offense v defense)

Bank Transactions (available only with credentials, with same as above and trans note in it's own field, at least a rolling month - 6 mo would be good)

Tax Records (same nation data points as above with tax rate and/or daily summary, rolling month?)

Trade Stats (same nation data points as above. A rolling week would be enough)

 

I know it's a lot of work to set up, but we'll need this kind of easy data access to develop our own reports, apps and widgets necessary to manage large AAs as the game grows.

 

Thanks Sheepy :)

 

_jess

Link to comment
Share on other sites

A daily csv dump of stats would be very helpful. That way anyone could pull them down and quickly do analytics. This kind of thing is critical for alliance management. It would allow us to easily create reports, identify members who need help or evaluate the success of econ programs.

 

Or better yet could we have a public facing url with a complete table of this information that uses a simple structured xpath or html table (like the city management screen)? That way we could develop our own 3rd party analytics dashboards linked directly to it.

 

The most useful tables would be:

Nation Stats

City Stats (with ruler name, nation name, and nation ID)

War Stats (same info as above, with a flag for offense v defense)

Bank Transactions (available only with credentials, with same as above and trans note in it's own field, at least a rolling month - 6 mo would be good)

Tax Records (same nation data points as above with tax rate and/or daily summary, rolling month?)

Trade Stats (same nation data points as above. A rolling week would be enough)

 

I know it's a lot of work to set up, but we'll need this kind of easy data access to develop our own reports, apps and widgets necessary to manage large AAs as the game grows.

 

Thanks Sheepy :)

 

_jess

 

pls Sheepy. pls. I've had to get really creative to be able to pull it these things. I'm pulling BK's war stats right now and it takes like 10 mins because it has to make like 500 requests

[22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made

 

BK in a nutshell

Link to comment
Share on other sites

If I can pull this info from the API, anyone can!

 

Only thing I've had to scrape is member lists.

 

Would be really nice though if we could have all the nation feed info for players in an alliance from a single API url rather than having to pull individual nations from separate urls.

Link to comment
Share on other sites

If I can pull this info from the API, anyone can!

 

Only thing I've had to scrape is member lists.

 

Would be really nice though if we could have all the nation feed info for players in an alliance from a single API url rather than having to pull individual nations from separate urls.

 

Still gotta scrape for war stats, trade, bank transactions, and tax records unfortunately. 

[22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made

 

BK in a nutshell

Link to comment
Share on other sites

Still gotta scrape for war stats, trade, bank transactions, and tax records unfortunately. 

 

Yeah.  I'm not so interested in that stuff.  I'm mostly looking at nation and alliance stats.

 

Bank transactions and tax is relatively easily copy pasted but a csv file would be quicker and easier.

 

War stats would be cool though.

Link to comment
Share on other sites

Yeah.  I'm not so interested in that stuff.  I'm mostly looking at nation and alliance stats.

 

Bank transactions and tax is relatively easily copy pasted but a csv file would be quicker and easier.

 

War stats would be cool though.

Not for excel. It seems to hate the format and I can never get it to paste with specific breakers. Do I just not know some extra setting with Excel copy+pasting from the web?

Link to comment
Share on other sites

Not for excel. It seems to hate the format and I can never get it to paste with specific breakers. Do I just not know some extra setting with Excel copy+pasting from the web?

 

HTML tables are easily handled with the data from web option (google sheets importHTML is a little nicer). Copy-paste bank information is easy if you discard the source formatting. Maybe if you're more specific with your problem we can be more helpful.

Link to comment
Share on other sites

pls Sheepy. pls. I've had to get really creative to be able to pull it these things. I'm pulling BK's war stats right now and it takes like 10 mins because it has to make like 500 requests

If you're using PHP, lookup rollingcurlx, for concurrent curl requests. I use it for accessing API as well as for scraping other pages. I don't have anything going over a minute yet, for my cron jobs, tracking 135 alliances and 608 nations.

 

Also split out your cron jobs (or however you're updating) and run them separately, so you're not updating all the data from a single script.

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

If you're using PHP, lookup rollingcurlx, for concurrent curl requests. I use it for accessing API as well as for scraping other pages. I don't have anything going over a minute yet, for my cron jobs, tracking 135 alliances and 608 nations.

 

Also split out your cron jobs (or however you're updating) and run them separately, so you're not updating all the data from a single script.

 

Interesting. I've been using regular curl for requests that require being logged in. Everything that only uses the API (with little scraping) doesn't take too long but things like war stats does.

 

Thanks for this though. Rollingcurlx looks really good so far.

[22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made

 

BK in a nutshell

Link to comment
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.