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
Flanderlion
Minister
 
Posts: 2226
Founded: Nov 25, 2013
Psychotic Dictatorship

Postby Flanderlion » Mon Aug 22, 2016 10:17 pm

[violet] wrote:
Flanderlion wrote:On topic though - is there any way to get just the new notifications rather than the last X notifications with the new shard?

By default it works the same way as the regular site, where it returns new notifications plus any from the last 48 hours. The new ones have a tag like: <NEW>1</NEW>. I could add a "newonly" parameter or something.

If it is easy, yes please. If not, probably not worth the effort. I just realised in my testing I was doing it with a nation that didn't have any new notices, so I might try and have a play around for a bit.
As always, I'm representing myself.
Information
Wishlist

User avatar
Atagait Denral
Secretary
 
Posts: 40
Founded: Jun 02, 2015
Ex-Nation

Postby Atagait Denral » Mon Aug 22, 2016 10:32 pm

Just curious, how come the string delimiter on most tags (WA Nations, Endorsements, etc) is a comma (,) but on the <nations> tag for regions, they're split with colons (:)? It doesn't actually make anything more difficult, but it's a weird inconsistency thing.

Edit: Would it be possible to get a shard for all WA nations in a region?
Last edited by Atagait Denral on Mon Aug 22, 2016 10:35 pm, edited 2 times in total.
Vleerian Vytherov
Script Writer

User avatar
Imperium Anglorum
GA Secretariat
 
Posts: 12659
Founded: Aug 26, 2013
Left-Leaning College State

Postby Imperium Anglorum » Wed Aug 24, 2016 8:18 am

Atagait Denral wrote:I found an incredibly handy work-around for getting delegate information via the API. It turns out polling all 19,131 regions isn't necessary. You can cut out all founderless regions, password regions, and class regions. Rather than taking 10 hours of requesting region data every 2 seconds, it neatly cuts it in half where you only have to spend about 5 hours.

It's still an absolutely absurd amount of time... but gotta get those non-exec founders somehow, amiright?

Use the daily dump.

Author: 1 SC and 56+ GA resolutions
Maintainer: GA Passed Resolutions
Developer: Communiqué and InfoEurope
GenSec (24 Dec 2021 –); posts not official unless so indicated
Delegate for Europe
Elsie Mortimer Wellesley
Ideological Bulwark 285, WALL delegate
Twice-commended toxic villainous globalist kittehs

User avatar
Ever-Wandering Souls
Negotiator
 
Posts: 7267
Founded: Jan 01, 2014
Father Knows Best State

Postby Ever-Wandering Souls » Wed Aug 24, 2016 10:33 am

Imperium Anglorum wrote:
Atagait Denral wrote:I found an incredibly handy work-around for getting delegate information via the API. It turns out polling all 19,131 regions isn't necessary. You can cut out all founderless regions, password regions, and class regions. Rather than taking 10 hours of requesting region data every 2 seconds, it neatly cuts it in half where you only have to spend about 5 hours.

It's still an absolutely absurd amount of time... but gotta get those non-exec founders somehow, amiright?

Use the daily dump.



[violet] wrote:
Zacherie wrote:
It's been asked before, but is there any chance of these being added to the regional data dump?

Yes, but right now we have length issues with the daily update, so I'm reluctant to add more load. Hopefully we can improve its run time in the near future and then add this.
Proud Raider; General of The Black Hawks, Ret.
TG me anytime; I'm always happy to talk about anything!

The Alicorns (Equestria) wrote:Let them stay, no need to badmouth them...From our view a bunch of nations just came in, seized the delegate position, and changed a few superficial things...we play NationStates differently...there's really no reason for us to be butthurt.
http://www.nationstates.net/page=rmb/postid=8944227
http://www.nationstates.net/page=rmb/postid=8951258

Misley wrote:
Hobbesistan wrote:Don't think I understand the question.
The color or what?..

Jesus, Hobbes, it's 2015. You can't just call someone "the color".

Reploid Productions wrote:Raiders are endlessly creative

How Do I Telegram API?

Omnis delenda est.

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Wed Aug 24, 2016 5:05 pm

Okay, fine! We'll trial OFFICERS, DELEGATEAUTH, and FOUNDERAUTH in region Daily Dumps.

User avatar
Flanderlion
Minister
 
Posts: 2226
Founded: Nov 25, 2013
Psychotic Dictatorship

Postby Flanderlion » Wed Aug 24, 2016 5:24 pm

[violet] wrote:Okay, fine! We'll trial OFFICERS, DELEGATEAUTH, and FOUNDERAUTH in region Daily Dumps.

Four hour tag raid? I'm looking forward to it. But in all seriousness, this seems cool, don't have plans to use it yet, but it seems like something I will use someday.
As always, I'm representing myself.
Information
Wishlist

User avatar
Agadar
Powerbroker
 
Posts: 7784
Founded: Dec 06, 2009
Psychotic Dictatorship

Postby Agadar » Sun Sep 04, 2016 4:05 pm

Hey Violet, it's been quite a while ago when I requested whether you could take a look at my NS API Java wrapper. Dare I ask whether you've done so yet, and if so, what your verdict is?

EDIT: On another note, am I correct in saying it is currently not supported to find refounded nations similarly to how one can find new nations?
Last edited by Agadar on Mon Sep 05, 2016 10:50 am, edited 1 time in total.
Proud resident of The Western Isles, the #1 role-playing region!
Developer of Telegrammer, NS API Java Wrapper, and more!

User avatar
Wyztrkstan
Minister
 
Posts: 2301
Founded: Sep 26, 2012
Ex-Nation

Postby Wyztrkstan » Sun Sep 04, 2016 9:47 pm

I don't know if this is the thread for this, but here it goes.

Since NS++ recruitment is no longer working, I looked around a bit and stumbled upon this:

viewtopic.php?f=15&t=338301

Since I saw the whole scripting controversy with the raiders a while back, I don't want to run into the same issues with a script. So, I'm just asking to make sure. Is this legal to use?
Please refer to me as The Greater Arslanid Empire, or just the Arslanid Empire ICly. Works better.
NO, this is NOT an Islamist nation.
Okay! Everyone say it with me! Wyz-Turk-Stan! There you go!
I am not of Middle Eastern Descent. I'm but a simple Haitian-American girl who decided to make an Ottoman based nation.
MT nation.
Nonhumans are not recognized so don't bother.

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

Postby Caelapes » Mon Sep 05, 2016 8:00 am

Wyztrkstan wrote:I don't know if this is the thread for this, but here it goes.

Since NS++ recruitment is no longer working, I looked around a bit and stumbled upon this:

http://forum.nationstates.net/viewtopic ... 5&t=338301

Since I saw the whole scripting controversy with the raiders a while back, I don't want to run into the same issues with a script. So, I'm just asking to make sure. Is this legal to use?

It's legal, and works very well.
    
The Rose Commune of Caelapes
Ego vero custos fratris mei sum.
aka Misley

User avatar
Wyztrkstan
Minister
 
Posts: 2301
Founded: Sep 26, 2012
Ex-Nation

Postby Wyztrkstan » Mon Sep 05, 2016 11:11 am

Caelapes wrote:
Wyztrkstan wrote:I don't know if this is the thread for this, but here it goes.

Since NS++ recruitment is no longer working, I looked around a bit and stumbled upon this:

http://forum.nationstates.net/viewtopic ... 5&t=338301

Since I saw the whole scripting controversy with the raiders a while back, I don't want to run into the same issues with a script. So, I'm just asking to make sure. Is this legal to use?

It's legal, and works very well.

Okay, thanks!
Please refer to me as The Greater Arslanid Empire, or just the Arslanid Empire ICly. Works better.
NO, this is NOT an Islamist nation.
Okay! Everyone say it with me! Wyz-Turk-Stan! There you go!
I am not of Middle Eastern Descent. I'm but a simple Haitian-American girl who decided to make an Ottoman based nation.
MT nation.
Nonhumans are not recognized so don't bother.

User avatar
Agadar
Powerbroker
 
Posts: 7784
Founded: Dec 06, 2009
Psychotic Dictatorship

Postby Agadar » Tue Sep 13, 2016 1:00 am

On another note: I have a need for my telegram app to be able to retrieve all nations in regions that have (or do not have) specified tags. Currently I do this by first retrieving the names of all the regions that have (or do not have) the specified tags using the regionsbytag-shard of the World API and then using that to individually retrieve the member nations of each region using the nations-shard of the Region API. However, this takes a lot of API calls and a lot of time.

I've looked into the Daily Data Dumps, but it seems they do not contain regional tags, so those aren't an option either. I'm looking forward to hear any alternatives there might exist.
Proud resident of The Western Isles, the #1 role-playing region!
Developer of Telegrammer, NS API Java Wrapper, and more!

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

Postby Eluvatar » Tue Sep 13, 2016 5:30 am

Agadar wrote:On another note: I have a need for my telegram app to be able to retrieve all nations in regions that have (or do not have) specified tags. Currently I do this by first retrieving the names of all the regions that have (or do not have) the specified tags using the regionsbytag-shard of the World API and then using that to individually retrieve the member nations of each region using the nations-shard of the Region API. However, this takes a lot of API calls and a lot of time.

I've looked into the Daily Data Dumps, but it seems they do not contain regional tags, so those aren't an option either. I'm looking forward to hear any alternatives there might exist.

You can use the API to discover which regions have which tags, then go through the daily data dumps and select those nations that it lists in the appropriate regions.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Agadar
Powerbroker
 
Posts: 7784
Founded: Dec 06, 2009
Psychotic Dictatorship

Postby Agadar » Tue Sep 13, 2016 5:33 am

Eluvatar wrote:
Agadar wrote:On another note: I have a need for my telegram app to be able to retrieve all nations in regions that have (or do not have) specified tags. Currently I do this by first retrieving the names of all the regions that have (or do not have) the specified tags using the regionsbytag-shard of the World API and then using that to individually retrieve the member nations of each region using the nations-shard of the Region API. However, this takes a lot of API calls and a lot of time.

I've looked into the Daily Data Dumps, but it seems they do not contain regional tags, so those aren't an option either. I'm looking forward to hear any alternatives there might exist.

You can use the API to discover which regions have which tags, then go through the daily data dumps and select those nations that it lists in the appropriate regions.


That's a great solution. Can't believe I hadn't thought of that yet. Thanks a lot!
Proud resident of The Western Isles, the #1 role-playing region!
Developer of Telegrammer, NS API Java Wrapper, and more!

User avatar
Atagait Denral
Secretary
 
Posts: 40
Founded: Jun 02, 2015
Ex-Nation

Postby Atagait Denral » Tue Sep 13, 2016 10:04 am

Could we get World Happenings type filters for Regional Happenings? I frequently finding myself wanting the sinceid, beforeid, and particularly filters (CTE+Changes).
Vleerian Vytherov
Script Writer

User avatar
Zemnaya Svoboda
Diplomat
 
Posts: 867
Founded: Jan 06, 2004
Civil Rights Lovefest

Postby Zemnaya Svoboda » Tue Sep 13, 2016 10:17 am

Atagait Denral wrote:Could we get World Happenings type filters for Regional Happenings? I frequently finding myself wanting the sinceid, beforeid, and particularly filters (CTE+Changes).


The world happenings can be viewed by region, although there are some oddities.

As Regional happenings are limited to 10 entries, I'm not sure that the benefit of such filters would be worth the cost of further complicating the API.

User avatar
Atagait Denral
Secretary
 
Posts: 40
Founded: Jun 02, 2015
Ex-Nation

Postby Atagait Denral » Tue Sep 13, 2016 11:37 pm

Zemnaya Svoboda wrote:
Atagait Denral wrote:Could we get World Happenings type filters for Regional Happenings? I frequently finding myself wanting the sinceid, beforeid, and particularly filters (CTE+Changes).


The world happenings can be viewed by region, although there are some oddities.

As Regional happenings are limited to 10 entries, I'm not sure that the benefit of such filters would be worth the cost of further complicating the API.


True. And I was aware of those oddities. I'll have to go for that.
Last edited by Atagait Denral on Tue Sep 13, 2016 11:38 pm, edited 2 times in total.
Vleerian Vytherov
Script Writer

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

Postby HMS Unicorn » Thu Sep 22, 2016 1:20 pm

Minor bug report

This nation is not in the World Assembly, and as far as I can tell has not been a member for at least two months: https://www.nationstates.net/nation=conscso_mal

However, it shows up in the API call for WA members, and has been listed there for at least a month: https://www.nationstates.net/cgi-bin/ap ... &q=members
Last edited by HMS Unicorn on Thu Sep 22, 2016 1:21 pm, edited 1 time in total.

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

Postby Eluvatar » Thu Sep 22, 2016 6:53 pm

HMS Unicorn wrote:Minor bug report

This nation is not in the World Assembly, and as far as I can tell has not been a member for at least two months: https://www.nationstates.net/nation=conscso_mal

However, it shows up in the API call for WA members, and has been listed there for at least a month: https://www.nationstates.net/cgi-bin/ap ... &q=members


Guess it's time to run my validation tool again.

The following nations listed in http://www.nationstates.net/cgi-bin/api ... /q=members are not WA nations:

Worse, the following WA nations are not listed in http://www.nationstates.net/cgi-bin/api.cgi/wa=1/q=members:
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
Drasnia
Minister
 
Posts: 2601
Founded: Feb 02, 2012
Ex-Nation

Postby Drasnia » Thu Sep 22, 2016 7:34 pm

What would lead the game to not validate these nations correctly?
See You Space Cowboy...

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

Postby Eluvatar » Fri Sep 23, 2016 5:45 am

Drasnia wrote:What would lead the game to not validate these nations correctly?

From what I recall, the most common causes are class regions and WA ejections.
To Serve and Protect: UDL

Eluvatar - Taijitu member

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

Postby HMS Unicorn » Fri Sep 23, 2016 8:00 pm

Minor bug report

In the World Assembly API, when using the "votetrack" and "dellog" shards with a resolution "id", they have no effect as expected:

https://www.nationstates.net/cgi-bin/api.cgi?wa=1&id=385&q=resolution+dellog
https://www.nationstates.net/cgi-bin/api.cgi?wa=1&id=385&q=resolution+votetrack

However, when using the "delvotes" shard, a DIV element reporting a system error appears:

https://www.nationstates.net/cgi-bin/api.cgi?wa=1&id=385&q=resolution+delvotes

This is inconsistent behavior (not just among these three shards, but also inconsistent with other API cases where shards have no effect). It is also problematic because the error-reporting DIV is not valid XML.

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

Postby Eluvatar » Fri Sep 23, 2016 8:03 pm

Flagged for attention.
To Serve and Protect: UDL

Eluvatar - Taijitu member

User avatar
[violet]
Executive Director
 
Posts: 16205
Founded: Antiquity

Postby [violet] » Sat Sep 24, 2016 2:33 pm

HMS Unicorn wrote:However, when using the "delvotes" shard, a DIV element reporting a system error appears:

Fixed, thanks.

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

Postby HMS Unicorn » Sun Sep 25, 2016 10:48 pm

Would it be possible to add an API request that gives the world-wide individual WA nation vote count for/against a WA resolution at vote?

Currently the only way to get this information is to make a gameside request to grab the GA or SC page, and then filter the Votes For and Votes Against reports to isolate the individual nation vote counts.

I would like to expand my WA voting records to also track worldwide individual vote counts. Having this information available through the API would make this a lot easier.

Thanks in advance!

User avatar
Agadar
Powerbroker
 
Posts: 7784
Founded: Dec 06, 2009
Psychotic Dictatorship

Postby Agadar » Tue Sep 27, 2016 4:42 am

Not sure whether it's a bug, but the nation's tgcancruit shard ignores whether or not a nation is a class member.
Proud resident of The Western Isles, the #1 role-playing region!
Developer of Telegrammer, NS API Java Wrapper, and more!

PreviousNext

Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Grand Exultia

Advertisement

Remove ads