NATION

PASSWORD

NationStates API (nationdata/regiondata)

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.

Advertisement

Remove ads

User avatar
HMS Unicorn
Spokesperson
 
Posts: 199
Founded: Jun 29, 2005
Ex-Nation

Postby HMS Unicorn » Sat Sep 23, 2017 4:08 pm

Aurum Raider wrote:On the Nation Data Dump, could the <INFLUENCE> tag be altered to have an attribute containing the SPDR stat, a la <INFLUENCE spdr="23">?

I'd love to see SPDR included in the nation dump as well.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Sat Sep 23, 2017 5:23 pm

Soft Power Disbursement Ranking and the Influence shard refer to different things: the SPDR census is a total of influence accumulations across any and all regions a nation has them in, while the Influence shard reflects the Influence level of the nation in the region as a word.

Would you be asking for the SPDR census to be included in the daily dumps or for the actual regional influence value behind the regional influence level and why or why not?
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
HMS Unicorn
Spokesperson
 
Posts: 199
Founded: Jun 29, 2005
Ex-Nation

Postby HMS Unicorn » Sat Sep 23, 2017 5:28 pm

Personally I'd like to see the SPDR census included. The reason for this is that I often have to process region-wide SPDR rankings in large regions (TNP, other GCRs, Europeia). Doing so currently requires a very large number of API calls to fetch all of the regional census=65 rankings and values. Having this information available in the nation dumps would make this process much easier and less bandwidth-intensive.

User avatar
Aurum Raider
Envoy
 
Posts: 239
Founded: Sep 18, 2014
Iron Fist Consumerists

Postby Aurum Raider » Sat Sep 23, 2017 7:13 pm

Eluvatar wrote:Soft Power Disbursement Ranking and the Influence shard refer to different things: the SPDR census is a total of influence accumulations across any and all regions a nation has them in, while the Influence shard reflects the Influence level of the nation in the region as a word.

Would you be asking for the SPDR census to be included in the daily dumps or for the actual regional influence value behind the regional influence level and why or why not?


SPDR, for the exact reason that HMS is asking for it. The actual regional influence would be nice, but unless I'm mistaken you can't get that from an API call to start with, and it's not what I was after anyway.

The only thing we can't get from the API that I might want is a region shard telling me when the region is going to update, but going out on a limb, I'd assume that isn't going to happen :p
Last edited by Aurum Raider on Sat Sep 23, 2017 7:19 pm, edited 1 time in total.
Vleerian Vytherov-Denral
Cognitohazard

The North Polish Union wrote:Additionally, virtually all founderless regions are viewed as falling under the defenders' allegedly protective purview. This is a form of colonialism that the great imperialist regions of NS history could only dream of.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Sun Sep 24, 2017 10:49 am

Aurum Raider wrote:The only thing we can't get from the API that I might want is a region shard telling me when the region is going to update, but going out on a limb, I'd assume that isn't going to happen :p


Why not?
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Roavin
Admin
 
Posts: 1777
Founded: Apr 07, 2016
Democratic Socialists

Postby Roavin » Sun Sep 24, 2017 11:20 am

Eluvatar wrote:
Aurum Raider wrote:The only thing we can't get from the API that I might want is a region shard telling me when the region is going to update, but going out on a limb, I'd assume that isn't going to happen :p


Why not?


omg thank you! If you can also add that to the dumps, I'll probably propose to you. :bow:
Helpful Resources: One Stop Rules Shop | API documentation | NS Coders Discord
About me: Longest serving Prime Minister in TSP | Former First Warden of TGW | aka Curious Observations

Feel free to TG me, but not about moderation matters.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Sun Sep 24, 2017 11:54 am

Is there a good reason not to do it?
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Roavin
Admin
 
Posts: 1777
Founded: Apr 07, 2016
Democratic Socialists

Postby Roavin » Sun Sep 24, 2017 2:22 pm

Eluvatar wrote:Is there a good reason not to do it?


The only reason I can think of is that you don't want me to propose to you. :P

(well and filesize but the difference should be negligible)
Last edited by Roavin on Sun Sep 24, 2017 2:27 pm, edited 2 times in total.
Helpful Resources: One Stop Rules Shop | API documentation | NS Coders Discord
About me: Longest serving Prime Minister in TSP | Former First Warden of TGW | aka Curious Observations

Feel free to TG me, but not about moderation matters.

User avatar
Aurum Raider
Envoy
 
Posts: 239
Founded: Sep 18, 2014
Iron Fist Consumerists

Postby Aurum Raider » Sun Sep 24, 2017 7:01 pm

Eluvatar, you cannot even comprehend how much I love you. :hug:

Do you think we can get the shard for nations?
Last edited by Aurum Raider on Sun Sep 24, 2017 7:30 pm, edited 1 time in total.
Vleerian Vytherov-Denral
Cognitohazard

The North Polish Union wrote:Additionally, virtually all founderless regions are viewed as falling under the defenders' allegedly protective purview. This is a form of colonialism that the great imperialist regions of NS history could only dream of.

User avatar
Altmoras
Diplomat
 
Posts: 827
Founded: Jan 25, 2012
Inoffensive Centrist Democracy

Postby Altmoras » Tue Sep 26, 2017 3:10 am

HMS Unicorn wrote:Personally I'd like to see the SPDR census included. The reason for this is that I often have to process region-wide SPDR rankings in large regions (TNP, other GCRs, Europeia). Doing so currently requires a very large number of API calls to fetch all of the regional census=65 rankings and values. Having this information available in the nation dumps would make this process much easier and less bandwidth-intensive.


This would be quite useful for a thought I had as well, would be very nice to just be able to grab the number for a nation.
Benevolent Thomas-Today at 11:15 AM
"I'm not sure if Altmoras has ever been wrong about anything."

Inhumanly good at the game according to official word of site staff.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Fri Oct 06, 2017 5:11 pm

I will add LASTUPDATE to the daily dumps.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Roavin
Admin
 
Posts: 1777
Founded: Apr 07, 2016
Democratic Socialists

Postby Roavin » Fri Oct 06, 2017 10:41 pm

Eluvatar wrote:I will add LASTUPDATE to the daily dumps.


*gets on one knee.....* :bow:
Helpful Resources: One Stop Rules Shop | API documentation | NS Coders Discord
About me: Longest serving Prime Minister in TSP | Former First Warden of TGW | aka Curious Observations

Feel free to TG me, but not about moderation matters.

User avatar
HMS Unicorn
Spokesperson
 
Posts: 199
Founded: Jun 29, 2005
Ex-Nation

Postby HMS Unicorn » Sat Oct 07, 2017 2:10 pm

Can we have hope that the censusid=65 influence score will be added too? Given that that's what started this discussion :P .

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Sat Oct 07, 2017 2:57 pm

There's no way we will add all the censuses. That leaves the question of how do we add just one census.

I defer to [violet].
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Caelapes
Ambassador
 
Posts: 1543
Founded: Apr 30, 2007
Ex-Nation

Postby Caelapes » Fri Oct 27, 2017 11:34 am

When will Z-Day data from last year (zombie action, survivors, dead, and number of zombies) reset on the API?
    
The Rose Commune of Caelapes
Ego vero custos fratris mei sum.
aka Misley

User avatar
Trotterdam
Postmaster-General
 
Posts: 10541
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Fri Oct 27, 2017 12:27 pm

Caelapes wrote:When will Z-Day data from last year (zombie action, survivors, dead, and number of zombies) reset on the API?
I think moments before the new pandemic begins.

Speaking of which, thanks for reminding me to test my zombie tracker to make sure it still works. Turns out my crude parser needed some tweaking on where to expect newlines.

User avatar
Fauxia
Senator
 
Posts: 4827
Founded: Dec 22, 2016
Left-Leaning College State

Postby Fauxia » Fri Oct 27, 2017 7:11 pm

Caelapes wrote:When will Z-Day data from last year (zombie action, survivors, dead, and number of zombies) reset on the API?
Well, N-Day reset 30 minutes before, so I might expect the same
Reploid Productions wrote:Unfortunately, Max still won't buy the mods elite ninja assassin squads to use, so... no such luck.
Sandaoguo wrote:GP is a den of cynics and nihilists
My opinions do not represent any NS governments I may happen to be in (yeah right), any RL governments I may happen to be in (yeah right), the CIA, the NSA, the FBI. the Freemasons, the Illuminati, Opus Dei, the Knights Templar, the Organization for the Advancement of Cultural Marxism, Opus Dei, or any other organization. Unless I say they do, in which case, there is a nonzero chance.

User avatar
Mantenos
Lobbyist
 
Posts: 14
Founded: Feb 22, 2017
Ex-Nation

Postby Mantenos » Mon Oct 30, 2017 4:17 am

Is there any way to limit the amount of API requests per minute on a google sheets document? I've got upwards of 200 shards I have to individually request but I can't do so without it importing all at once, locking me out for 15 minutes continuously. I could look into the daily dumps but that's a bit more manual work I was hoping to avoid.
Last edited by Mantenos on Mon Oct 30, 2017 4:41 am, edited 1 time in total.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Mon Oct 30, 2017 5:42 am

This happened due to my mistake. :(
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Mantenos
Lobbyist
 
Posts: 14
Founded: Feb 22, 2017
Ex-Nation

Postby Mantenos » Mon Oct 30, 2017 5:57 am

Eluvatar wrote:This happened due to my mistake. :(


Could you elaborate?

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Mon Oct 30, 2017 6:09 am

Mantenos wrote:
Eluvatar wrote:This happened due to my mistake. :(


Could you elaborate?


I made a small change and didn't check its correctness in the right way and accidentally uploaded it before I meant to. :blush:

Edit: and I just realized I posted in the wrong topic. My post should've been here: viewtopic.php?f=15&t=427116
Last edited by Eluvatar on Mon Oct 30, 2017 6:11 am, edited 1 time in total.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Mantenos
Lobbyist
 
Posts: 14
Founded: Feb 22, 2017
Ex-Nation

Postby Mantenos » Mon Oct 30, 2017 6:19 am

Oh okay. My question still stands then.

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Mon Oct 30, 2017 7:15 pm

Mantenos wrote:Is there any way to limit the amount of API requests per minute on a google sheets document? I've got upwards of 200 shards I have to individually request but I can't do so without it importing all at once, locking me out for 15 minutes continuously. I could look into the daily dumps but that's a bit more manual work I was hoping to avoid.


The way to rate limit google sheets, and indeed to split the results of one API request across multiple cells, is to write googlescript code. This and this other sheet may be useful as examples, and this post may be helpful at following the rules.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Minoa
Negotiator
 
Posts: 6079
Founded: Oct 05, 2011
Civil Rights Lovefest

Postby Minoa » Thu Nov 02, 2017 7:54 am

While testing a census query (https://www.nationstates.net/cgi-bin/ap ... mode=score and https://www.nationstates.net/cgi-bin/ap ... p;scale=76), I noticed that Census ID 76 is returning a number in exponential form, but the "gdp" shard returns the full number correctly.

I wonder if the Census ID 76 shard can be shown as a full number like the "gdp" shard?

Also, I would like to see the ability to exclude certain shards while doing the "scale=all" query: for example, I type "scale=all-81-82-83-84" (literally "all scales except 81-84") to exclude the Zombie-related shards.

-- Minoa
Last edited by Minoa on Thu Nov 02, 2017 8:05 am, edited 1 time in total.
Mme A. d'Oiseau, B.A. (State of Minoa)

User avatar
Eluvatar
Director of Technology
 
Posts: 3086
Founded: Mar 31, 2006
New York Times Democracy

Postby Eluvatar » Thu Nov 02, 2017 10:22 am

Minoa wrote:While testing a census query (https://www.nationstates.net/cgi-bin/ap ... mode=score and https://www.nationstates.net/cgi-bin/ap ... p;scale=76), I noticed that Census ID 76 is returning a number in exponential form, but the "gdp" shard returns the full number correctly.

I wonder if the Census ID 76 shard can be shown as a full number like the "gdp" shard?

Also, I would like to see the ability to exclude certain shards while doing the "scale=all" query: for example, I type "scale=all-81-82-83-84" (literally "all scales except 81-84") to exclude the Zombie-related shards.

-- Minoa


I think it would make sense for 'all' to mean 'all active' and ignore the shards that aren't being updated. I would like to confirm [violet] doesn't have any issue with such a change first however.

I have no thoughts on census 76.
To Serve and Protect: UDL

Eluvatar - Taijitu member

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Aserlandia, Great Indonesian Republic, New Flailia, North American Imperial State, Osheiga, The Archregimancy, The United British Kingdom

Advertisement

Remove ads