Page 79 of 97

PostPosted: Mon Sep 02, 2019 9:31 am
by New Rogernomics
Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?

PostPosted: Mon Sep 02, 2019 10:06 am
by Phydios
New Rogernomics wrote:Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?

API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.

PostPosted: Mon Sep 02, 2019 4:40 pm
by New Rogernomics
Phydios wrote:
New Rogernomics wrote:Hey there, I have a two part question, if this is the right place to ask this.

I have been learning more about how the Nationstates Telegram API is implemented, and I have a question concerning this.

If a nation is a founder in a UCR, or the delegate of a GCR, and they allow nation X to get the API key for recruiting, and nation X CTEs, does that only API key become open to nation Y to acquire the key?

API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.
That is not correct apparently. There is only one key per region. If you don't know the key or have access to it, then no other nation can use it. A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.

PostPosted: Mon Sep 02, 2019 5:18 pm
by Frisbeeteria
Phydios wrote:API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.

There's a lot wrong with this statement. Keys are tied to a region, but a single nation is considered 'responsible' for it. If another nation misuses the key, the responsible nation could get a warning. Sharing a key requires a fair bit of trust.

Also, "any time that no one else is using it" is misleading. Multiple nations can use the same key simultaneously - it's just pointless. The rate limit applies to the key rather than the nation, so every recruiter after the first will probably bounce 100% of their attempts.

New Rogernomics wrote:A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.

In such cases, a Getting Help Request can get the old key deactivated and a new key issued. Same if the old recruiter nation moved to a new region. Unfortunately, it's not the same for living-but-inactive recruiter nations. We won't reissue the key if the nation is alive and still in the region.

New Rogernomics wrote: does that only API key become open to nation Y to acquire the key?

We'd issue a different key, cancelling the old one.

PostPosted: Mon Sep 02, 2019 7:09 pm
by New Rogernomics
Okay I get how it works now.

I had thought it would be a bit odd if a key could get lost forever.

Thanks for explaining it.

PostPosted: Mon Sep 02, 2019 8:43 pm
by Phydios
Frisbeeteria wrote:
Phydios wrote:API keys are issued per region, so they aren't locked to a specific nation. Nation Y can use the key any time that no one else is using it.

There's a lot wrong with this statement. Keys are tied to a region, but a single nation is considered 'responsible' for it. If another nation misuses the key, the responsible nation could get a warning. Sharing a key requires a fair bit of trust.

Also, "any time that no one else is using it" is misleading. Multiple nations can use the same key simultaneously - it's just pointless. The rate limit applies to the key rather than the nation, so every recruiter after the first will probably bounce 100% of their attempts.

New Rogernomics wrote:A good example would be where a regional officer nation or a founder acquires the key, and then CTEs.

In such cases, a Getting Help Request can get the old key deactivated and a new key issued. Same if the old recruiter nation moved to a new region. Unfortunately, it's not the same for living-but-inactive recruiter nations. We won't reissue the key if the nation is alive and still in the region.

New Rogernomics wrote: does that only API key become open to nation Y to acquire the key?

We'd issue a different key, cancelling the old one.

Got it. Thanks for the clarification. I was going off my own experience with the Telegram API.

PostPosted: Thu Sep 26, 2019 6:59 am
by Minoa
Regarding: https://www.nationstates.net/cgi-bin/ap ... ction;id=1

Hello, I wish to ask if there is a way to combine queries for N-Day faction data… strikes, stockpiled nukes and all that? For example, https://www.nationstates.net/cgi-bin/ap ... ;id=1;id=2 doesn't work.

Best,

-- Minoa

PostPosted: Thu Sep 26, 2019 12:15 pm
by RantSpot
I saw requests by The Northern Light for some card API shards back in January and March. Was there ever any decision on that? It makes sense for cards to only be generated by manual website issue answers and not API, but all the other card game features e.g. buying, auctioning, valuing could be handled by API, and other rich applications could be built for the marketplace.

PostPosted: Fri Sep 27, 2019 4:53 am
by Minoa
Source: https://www.nationstates.net/cgi-bin/ap ... ion;id=246

I have observed that the API is not recording the names of the regions which a faction belongs to, if region in question ceased to exist. I believe that the name of the region should stay as a matter of historical record.

-- Minoa

PostPosted: Sat Nov 02, 2019 2:33 pm
by Darcania
Could it be made possible to have a private nation API shard to apply to (not join, just apply to) the World Assembly?

PostPosted: Sun Nov 03, 2019 3:58 am
by Flanderlion
Darcania wrote:Could it be made possible to have a private nation API shard to apply to (not join, just apply to) the World Assembly?

I would assume that it would still be illegal to use a script to apply to join the WA. Admins replied multiple times re that until finally it was settled my script for it was illegal as it was generating a happening other that my nation page. Wasn't 100% on the logic from it, but they've got the GHR history to go through to see what they said in the past.

If it is legal, yes please, is very helpful for prepping tagging puppets.

Edit: Added missing it.
Edit 2: Was 3, almost 4 years ago, script rules were edited following it. I've only got the replies, not what I sent.

PostPosted: Fri Nov 22, 2019 4:56 am
by Valentine Z
viewtopic.php?p=36459354#p36459354

Cross-posting from my own thread, I recently noticed and realised that there are undocumented (at least on the API Doc itself) ways of getting more precise data for some NS Stats.

For instance, http://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=census&scale=68&mode=score is a well-known and what I have been using to get the stats as they appear on the census. However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.

This would explain why as the bigger nations continue to answer issues, their HDI increments at 0.01 on the gameside, but in reality... there are minute changes that are still happening, and eventually, they will round up and give that 0.01.

I wonder if there are precise values for Integrity, Civil Rights, Economy, etc... basically a way to get all these stats' precise results instead of the rounded http://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=census&scale=all&mode=score.

PostPosted: Fri Nov 22, 2019 9:40 am
by Trotterdam
Valentine Z wrote:However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.
Wow, it's possible to track people's lifespans to an accuracy of three microseconds?

PostPosted: Fri Nov 22, 2019 11:43 am
by Valentine Z
Trotterdam wrote:
Valentine Z wrote:However... https://www.nationstates.net/cgi-bin/api.cgi?nation=valentine_z&q=hdi, whereby q=hdi is not mentioned in the public shard section, gives precise HDI values, to several decimal places.
Wow, it's possible to track people's lifespans to an accuracy of three microseconds?

Happy 14th and 1 microsecond birthday, to you. :P

PostPosted: Fri Nov 22, 2019 4:57 pm
by The Order of the Holy Inquisitors
Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?

PostPosted: Fri Nov 22, 2019 7:36 pm
by Trotterdam
The Order of the Holy Inquisitors wrote:Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?
Yes, setting a user agent is still mandatory.

The way to do this should be specified in the documentation for whichever wrapper you're using. If you can't find it, it's probably best to contact the wrapper's author for help.

PostPosted: Fri Nov 22, 2019 10:37 pm
by The Order of the Holy Inquisitors
Trotterdam wrote:
The Order of the Holy Inquisitors wrote:Hi there! I'm currently trying my hand at some basic data retrieval stuff using a wrapper for the API (was bored and thus looking for a challenge), and I noticed that on the Wrapper documentation page (here), it states I must "set a user agent." If I'm using a wrapper, is this step still mandatory, and if so, could you please direct me as to how exactly I should go about doing that?
Yes, setting a user agent is still mandatory.

The way to do this should be specified in the documentation for whichever wrapper you're using. If you can't find it, it's probably best to contact the wrapper's author for help.

Thank you so much! I'll get on that ASAP

Edit: I think I got it set properly (registers my nation site link as the value of the userAgent variable and logs to the console the name of the wrapper creator and me as a "user" of it. I think this is enough, but if I want to double check, would I just go to the author of the wrapper again?

PostPosted: Sat Nov 23, 2019 12:17 am
by Trotterdam
The Order of the Holy Inquisitors wrote:Edit: I think I got it set properly (registers my nation site link as the value of the userAgent variable and logs to the console the name of the wrapper creator and me as a "user" of it. I think this is enough, but if I want to double check, would I just go to the author of the wrapper again?
For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff (for which this is the right thread, so just wait and hope for a response), since they're the only ones with the authority to make a ruling on that. The wrapper just determines how you set your user agent, not what you should set it to.

I don't understand what you mean by "logs to the console", though. Unless I'm misunderstanding, what your program logs to your console shouldn't be relevant to anyone except yourself.

PostPosted: Sat Nov 23, 2019 9:59 am
by Frisbeeteria
Trotterdam wrote:For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff

We want something that will let us get back to you if something goes wrong. Your main nation or email address are both acceptable. I'd personally go for 'blatantly obvious' and call mine "Frisbeeteria Recruitment Script".

PostPosted: Sat Nov 23, 2019 4:48 pm
by The Order of the Holy Inquisitors
Trotterdam wrote:For clarification on what constitutes a sufficiently-informative user agent you'll need to contact the actual game staff (for which this is the right thread, so just wait and hope for a response), since they're the only ones with the authority to make a ruling on that. The wrapper just determines how you set your user agent, not what you should set it to.

I don't understand what you mean by "logs to the console", though. Unless I'm misunderstanding, what your program logs to your console shouldn't be relevant to anyone except yourself.

Okay. I was just logging the value that I set it to to my own console to make sure it worked. Thank you for your help!

Frisbeeteria wrote:We want something that will let us get back to you if something goes wrong. Your main nation or email address are both acceptable. I'd personally go for 'blatantly obvious' and call mine "Frisbeeteria Recruitment Script".

I put the link to my nation.

PostPosted: Tue Dec 03, 2019 4:44 pm
by SherpDaWerp
Is there a more efficient way for me to query the political freedoms/civil rights/economic freedoms for every nation than just slowly going through every nation individually? I'm looking to build up an idea of the thresholds for each WA classification, so a large sample size (every nation) is best IMO.

Economic Freedom is not listed in the daily dump, although civil rights, political freedoms and WA classification are. At the moment, it looks like my best option is to use the daily dump, but then I'd still have to manually query the economic freedom of every nation. (Despite the fact that there is ECONOMY under FREEDOM and FREEDOMSCORES, these values represent the economic strength census rather than the economic freedom one...)

PostPosted: Wed Dec 11, 2019 4:58 pm
by [violet]
There is now a Cards API in development. It's subject to change without warning, but is pretty functional already.

Documentation here:

https://www.nationstates.net/pages/api.html#cards

PostPosted: Wed Dec 11, 2019 5:47 pm
by Flanderlion
[violet] wrote:There is now a Cards API in development. It's subject to change without warning, but is pretty functional already.

Documentation here:

https://www.nationstates.net/pages/api.html#cards

Thanks for writing this up, was trying to keep track through a myriad of bookmarks. Can you add the two card files to the doc as well? Probably under the Daily Dump section.

PostPosted: Wed Dec 11, 2019 8:59 pm
by [violet]
Flanderlion wrote:Can you add the two card files to the doc as well? Probably under the Daily Dump section.

What do you mean?

PostPosted: Thu Dec 12, 2019 3:49 am
by Flanderlion
[violet] wrote:
Flanderlion wrote:Can you add the two card files to the doc as well? Probably under the Daily Dump section.

What do you mean?

viewtopic.php?f=42&t=468779

These two files, just so everything that would help tool related wise is in the same place.