Advertisement
by Merni » Thu Apr 30, 2020 1:26 am
by [violet] » Thu Apr 30, 2020 9:48 pm
Merni wrote:Does the Region API messages shard use Unicode?
by Merni » Thu Apr 30, 2020 10:46 pm
[violet] wrote:Merni wrote:Does the Region API messages shard use Unicode?
Not really, no. It outputs UTF-8 after attempting to reconstruct it from a database that contains a mix of different encodings, support for which were bolted on one at a time as the web became steadily less ASCIIish. So it works fine 99% of the time but occasionally there's a character that dodged proper encoding because it came in through some sub-system that wasn't fully compliant, and can't be output properly without scrambling the stuff that was encoded properly. It's one of those problems that's easy to get right the first time, but very challenging to fix once you have accumulated 18 years of data.
by Katanga Vristaadt » Fri May 01, 2020 1:49 pm
by SherpDaWerp » Fri May 01, 2020 4:27 pm
Katanga Vristaadt wrote:My telegram client says "403 Client Not Registered For API." It worked fine yesterday. Is anyone experiencing the same problem? Does anyone know how to fix this?
by Frisbeeteria » Fri May 01, 2020 6:10 pm
SherpDaWerp wrote:then maybe file a GHR to check it's still registered.
by SherpDaWerp » Fri May 01, 2020 10:56 pm
The easiest and quickest way is to download and search the Daily Dumps, rather than make API calls for every nation, although that depends on the size of the region. Anything over 50 members and it's certainly better to just use the dumps. If you then want it to be 100% up-to-date, then make one call to the regional Happenings for any new WA nations and log those, instead of calling for every nation.HN67 wrote:Is there a way to easily look at who a nation has endorsed? All I have come up with is checking the endorsement list of all WA members in the region.
by Aurum Raider » Wed May 13, 2020 6:08 pm
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.
by Akragas » Thu May 14, 2020 4:10 am
by West Leas Oros 2 » Sun May 17, 2020 10:04 am
WLO Public News: Outdated Factbooks and other documents in process of major redesign! ESTIMATED COMPLETION DATE: <error:not found>
by Merni » Sun May 17, 2020 11:09 am
West Leas Oros 2 wrote:I just got an API code for my region, a recruitment one, and I made a telegram template to send to recruits, and now I’m wondering how to send it out?
by West Leas Oros 2 » Sun May 17, 2020 11:15 am
WLO Public News: Outdated Factbooks and other documents in process of major redesign! ESTIMATED COMPLETION DATE: <error:not found>
by Aurum Raider » Sat Jun 06, 2020 10:46 pm
<WORLD>
<HAPPENINGS>
<EVENT id="0000000">
<TIMESTAMP>000000000</TIMESTAMP>
<TEXT>
@@nation@@ lodged <!CDATA[message]]> on the %%region%% Regional Message Board.
<TEXT>
</EVENT>
</HAPPENINGS>
</WORLD>
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.
by Ever-Wandering Souls » Thu Jun 11, 2020 12:36 am
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
Reploid Productions wrote:Raiders are endlessly creative
by Eluvatar » Thu Jun 11, 2020 9:37 am
Aurum Raider wrote:Could a new world/region API shard that contains the content of new RMB posts be added?
Ideally, it would allow one script to compile live RMB feeds of multiple regions without having to make an API request for each one.
If it were to be implemented as a new happenings filter, it would ideally look something like this
- Code: Select all
<WORLD>
<HAPPENINGS>
<EVENT id="0000000">
<TIMESTAMP>000000000</TIMESTAMP>
<TEXT>
@@nation@@ lodged <!CDATA[message]]> on the %%region%% Regional Message Board.
<TEXT>
</EVENT>
</HAPPENINGS>
</WORLD>
<WORLD>
<MESSAGES>
<POST id="12345678">
<TIMESTAMP>1591893320</TIMESTAMP>
<NATION>testlandia</NATION>
<REGION>Testregionia</REGION>
<STATUS>0</STATUS>
<LIKES>1</LIKES>
<LIKERS>el_test</LIKERS>
<MESSAGE>Hello</MESSAGE>
</POST>
</MESSAGES>
</WORLD>
by Aurum Raider » Thu Jun 11, 2020 11:49 am
Eluvatar wrote:Adding messages to the world API is certainly possible, but I'd expect it to look more like
- Code: Select all
<WORLD>
<MESSAGES>
<POST id="12345678">
<TIMESTAMP>1591893320</TIMESTAMP>
<NATION>testlandia</NATION>
<REGION>Testregionia</REGION>
<STATUS>0</STATUS>
<LIKES>1</LIKES>
<LIKERS>el_test</LIKERS>
<MESSAGE>Hello</MESSAGE>
</POST>
</MESSAGES>
</WORLD>
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.
by The Northern Light » Wed Jun 24, 2020 9:15 am
https://www.nationstates.net/cgi-bin/api.cgi?q=cards+collections;nationname=testlandia
https://www.nationstates.net/cgi-bin/api.cgi?q=cards+info+deck+collections;nationname=testlandia
Home of the WADP, Planet Eras, and the Constibillocode!
by Valars » Wed Jun 24, 2020 3:36 pm
by Merni » Fri Jun 26, 2020 1:08 am
Valars wrote:(im new to the API by the way, so sorry if i make a REALLY stupid question here)
Hey, quick question here. Is the python wrapper on the main API page (aka the docs) still up-to-date/useful? was just asking because i saw it not being updated for about a year and the original creator CTEd. If its outdated/useless, are there any good alternatives?
by Valars » Fri Jun 26, 2020 8:03 am
Merni wrote:Valars wrote:(im new to the API by the way, so sorry if i make a REALLY stupid question here)
Hey, quick question here. Is the python wrapper on the main API page (aka the docs) still up-to-date/useful? was just asking because i saw it not being updated for about a year and the original creator CTEd. If its outdated/useless, are there any good alternatives?
That wrapper should still work (it did when I last used it some months ago), but if you find some issue in it then you might have to fix it yourself since the author has CTEd.
As far as I know there is no other Python wrapper available. There are wrappers for other languages linked on that page, but I don't know how active or maintained they are.
Anyway, depending on what you're using the API for, it's pretty easy to query it yourself without a wrapper, using the requests (more high-level and easy to use but must be installed) or urllib (standard library, low-level) packages. I use urllib in my tools.
Edit: I forgot about sans. It's another Python wrapper, but is for much more advanced uses, and its author seems to also have CTEd. It's used for this Discord bot.
by Merni » Fri Jun 26, 2020 8:42 am
Valars wrote:Merni wrote:That wrapper should still work (it did when I last used it some months ago), but if you find some issue in it then you might have to fix it yourself since the author has CTEd.
As far as I know there is no other Python wrapper available. There are wrappers for other languages linked on that page, but I don't know how active or maintained they are.
Anyway, depending on what you're using the API for, it's pretty easy to query it yourself without a wrapper, using the requests (more high-level and easy to use but must be installed) or urllib (standard library, low-level) packages. I use urllib in my tools.
Edit: I forgot about sans. It's another Python wrapper, but is for much more advanced uses, and its author seems to also have CTEd. It's used for this Discord bot.
Hey, i tried importing Sans doing (without quotes) 'pip install sans' this threw out a big error, then tried 'pip install -U sans' same error, i even tried the way the python website said to install libraries but still get the same error. i made sure to download all the other libs it needs (lxml and aiohttp) but still cant download with the same error. Do you have any idea on how this could be fixed?
by Aurum Raider » Fri Jun 26, 2020 7:00 pm
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.
by The Northern Light » Thu Jul 02, 2020 2:48 pm
The Northern Light wrote:HMS Unicorn wrote:Would it be possible to revisit this suggestion?
It was brought up here, and several players mentioned they would benefit from the addition. But the discussion soon digressed to including LASTUPDATE in the dumps.
It'd save me a few dozens of thousands of API calls per day, and I imagine it's the same for many other players.
I'd like to bump this request. Adding the SPDR metric in the national dumps would be enormously useful for a large swath of (at least) gameplayers, who frequently need to comb through influence statistics for various purposes (regional security, R/D, WA and endotarting promotion, etc.).
Given that compiling influence statistics often requires fetching the SPDR of entire region populations one nation at a time, it would save both the players and the server a considerable amount of API bandwidth.
The nation dumps already include a few other censuses in various forms, namely CENSUSIDs 0, 1, 2, 3, and 49 (there is also a "PUBLICSECTOR" field for which I could not determine whether it corresponds to a CENSUSID). I understand that at least the first four are "special" censuses (respectively: the three censuses that determine a nation's category, and population). I'd argue that SPDR is also special, given its role in determining the feasibility/outcome of many gameplay actions. Therefore, it should be included in the nation dumps, just as CENSUSIDs 0-3 are.
Home of the WADP, Planet Eras, and the Constibillocode!
by The Northern Light » Fri Jul 03, 2020 4:05 am
Home of the WADP, Planet Eras, and the Constibillocode!
Advertisement
Users browsing this forum: Bookment, Inferior, Knights of LUSITANIA, La Xinga, Meadrin, Micro Gettysburg, Montandi-Cisalpina, Pacfican States, Pauriun, Pygania, Sicias, The Micro Union, The Xolbarian Opposition
Advertisement