Advertisement
by Flanderlion » Sat Apr 29, 2023 3:08 am
by Klaus Devestatorie » Sat Apr 29, 2023 3:59 am
by Trotterdam » Sat Apr 29, 2023 4:30 am
You can't. You'll have to either put in the work to process multiple API calls, or give up on your goals.Klaus Devestatorie wrote:I'm not trying to make 500 API calls, though. I'm just trying to make one API call that has all the data I want, with no intention of making this call more than once a day.
You can: https://www.nationstates.net/cgi-bin/api.cgi?region=ordo_imperialia&q=censusranks;scale=1;start=21.Klaus Devestatorie wrote:There doesn't appear to be an option to let me select any group of 20 nations other than the 20 highest rated nations for that census, so I can't request by region in successive calls.
by Klaus Devestatorie » Sat Apr 29, 2023 5:27 am
Trotterdam wrote:You can't. You'll have to either put in the work to process multiple API calls, or give up on your goals.Klaus Devestatorie wrote:I'm not trying to make 500 API calls, though. I'm just trying to make one API call that has all the data I want, with no intention of making this call more than once a day.You can: https://www.nationstates.net/cgi-bin/api.cgi?region=ordo_imperialia&q=censusranks;scale=1;start=21.Klaus Devestatorie wrote:There doesn't appear to be an option to let me select any group of 20 nations other than the 20 highest rated nations for that census, so I can't request by region in successive calls.
However, this is somewhat risky. If the ordering changed between API calls (such as from a nation answering an issue just as you're fetching the data, or from a nation entering or leaving the region), then you could get a particular nation listed twice, while another nation might get skipped over entirely. Doing it the way I suggested at least guarantees that you get data from approximately the same time on every nation in the region, even if it might not all be from exactly the same time.
let
Source = Csv.Document(Web.Contents("https://www.nationstates.net/cgi-bin/api.cgi?a=useragent", [Headers=[UserAgent="nation=Klaus Devestatorie"]]),[Delimiter=",", Columns=1, Encoding=1252]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}})
in
#"Changed Type"
by Bowzin » Sat Apr 29, 2023 2:25 pm
Klaus Devestatorie wrote:-snip-
by Hesskin Empire » Sat May 13, 2023 11:35 am
Queen of Tannborn and Kronenberg, Duchess of Ansrau, Helmfurt, and Fürstenzell, Margrave of Osterhausen and Delmenfingen, and Lady of Hügelstat and Kaiserin-Emeritus of Hartfelden |
Her Grace the Duchess of Eprom, Marquis of Kammara, Earl of Upper Strathia, and Lady Mayor of Zelva of Sildoria |
Taskmaster of the Brotherhood of Malice |
Countess Sylvoria, Baroness Tybradia and Lady Marshal of Kantrias |
Enforcer of Alcatraz |
The Rt. Hon. Earl of Leinster, Viscountess of Dublin, Baroness of Greenwich, First Sea Lady (Ret.) in the Empire of Great Britain |
by Bowzin » Sat May 13, 2023 12:26 pm
Hesskin Empire wrote:So I was messing about with some code and realized that the new WA nations shard has a comma (,) as a delimiter while the residents (NATION) shard has a colon (:) as a delimiter... was this on purpose to differentiate between shards in some way? I know it caused me some time debugging before realizing lmao.
(Note: I haven't checked other shards so I don't know if they tend to share delimiters or have unique ones)
by Eluvatar » Sat May 13, 2023 9:31 pm
Hesskin Empire wrote:So I was messing about with some code and realized that the new WA nations shard has a comma (,) as a delimiter while the residents (NATION) shard has a colon (:) as a delimiter... was this on purpose to differentiate between shards in some way? I know it caused me some time debugging before realizing lmao.
(Note: I haven't checked other shards so I don't know if they tend to share delimiters or have unique ones)
by Hesskin Empire » Sun May 14, 2023 7:54 am
Eluvatar wrote:Hesskin Empire wrote:So I was messing about with some code and realized that the new WA nations shard has a comma (,) as a delimiter while the residents (NATION) shard has a colon (:) as a delimiter... was this on purpose to differentiate between shards in some way? I know it caused me some time debugging before realizing lmao.
(Note: I haven't checked other shards so I don't know if they tend to share delimiters or have unique ones)
It was intended to be consistent with the newer shards and with what is more common in the wider world of data.
Queen of Tannborn and Kronenberg, Duchess of Ansrau, Helmfurt, and Fürstenzell, Margrave of Osterhausen and Delmenfingen, and Lady of Hügelstat and Kaiserin-Emeritus of Hartfelden |
Her Grace the Duchess of Eprom, Marquis of Kammara, Earl of Upper Strathia, and Lady Mayor of Zelva of Sildoria |
Taskmaster of the Brotherhood of Malice |
Countess Sylvoria, Baroness Tybradia and Lady Marshal of Kantrias |
Enforcer of Alcatraz |
The Rt. Hon. Earl of Leinster, Viscountess of Dublin, Baroness of Greenwich, First Sea Lady (Ret.) in the Empire of Great Britain |
by Roavin » Sun May 14, 2023 12:06 pm
by Sandaoguo » Mon May 15, 2023 7:08 pm
by Bowzin » Mon May 15, 2023 7:30 pm
Sandaoguo wrote:Would it be possible to add a "Founded In" stat to the nation API, recording the region in which the nation was founded? Ideally within the default set of shards delivered by the base parameter.
by Trotterdam » Tue May 16, 2023 12:03 am
by Sandaoguo » Tue May 16, 2023 6:12 am
Trotterdam wrote:Why would we track that? I don't want a region that I stayed in for 1.5 seconds before moving out to be a permanent mark on my record.
by Roavin » Wed May 17, 2023 1:27 am
by Darcania » Wed May 17, 2023 9:38 am
Roavin wrote:Not documented (yet), but check this out: api.cgi?q=newnationdetails
by Darcania » Wed May 17, 2023 4:03 pm
by Merni » Thu May 18, 2023 11:18 am
by Udenstar » Thu May 18, 2023 8:35 pm
by United Calanworie » Thu May 18, 2023 11:13 pm
Udenstar wrote:I would like to have a record of my activity from when my nation was created to current. On the activities page, it seems to only show the past 6 or 7 days (possibly a specific number of events?) with no option to go back further. Instead of cluttering up that page, could it be possible to get more log entries via the API?
Data from Issues seem to be found on those individual issues. What isn't included is how World Assembly changes impact the nation or record of nation moves, gaining/losing endorsements, etc.
If these data points are kept in the NationStates database, why can't they be available to the player?
<NATION id="testlandia">
<HAPPENINGS>
<EVENT>
<TIMESTAMP>1683674301</TIMESTAMP>
<TEXT>
Following new legislation in @@testlandia@@, real power lies not in the debating room but with those who decide what is debated.
</TEXT>
</EVENT>
</HAPPENINGS>
</NATION>
by Eluvatar » Thu Jun 01, 2023 7:00 am
Udenstar wrote:If these data points are kept in the NationStates database, why can't they be available to the player?
by Lemmingtopias » Fri Jun 09, 2023 5:23 am
LBC News:Lemmingtopias now de facto split between East and West | Junta forces fail to storm Palace of the Sages, withdrawal from West Lomapolis | COUP! Advised to stay at home! More Info coming soon | Prince of Lemmingtopias killed during summit with Tropican President| Invasion of The Tropican Islands cancelled. Diplomatic talks to resume
by Roavin » Fri Jun 09, 2023 6:40 pm
Lemmingtopias wrote:Does NS keep a log of the amount of unique issues answered, or options answered?
And if so, is that something that could be added as a shard alongside the current answered shard?
by Lemmingtopias » Sat Jun 10, 2023 2:21 am
LBC News:Lemmingtopias now de facto split between East and West | Junta forces fail to storm Palace of the Sages, withdrawal from West Lomapolis | COUP! Advised to stay at home! More Info coming soon | Prince of Lemmingtopias killed during summit with Tropican President| Invasion of The Tropican Islands cancelled. Diplomatic talks to resume
Advertisement
Users browsing this forum: Daphomir, The Overmind
Advertisement