Page 3 of 97

PostPosted: Thu May 06, 2010 12:20 am
by The Most Glorious Hack
[violet] wrote:Possibly fixed for update in 22 hours from now, but possibly not because I'm not really sure what's going on.

Remind me again how you got this job? :p

PostPosted: Thu May 06, 2010 2:18 am
by New Spartzerina
The Most Glorious Hack wrote:
[violet] wrote:Possibly fixed for update in 22 hours from now, but possibly not because I'm not really sure what's going on.

Remind me again how you got this job? :p

[violet] is actually Max Barry? :p

PostPosted: Thu May 06, 2010 4:22 pm
by [violet]
The Most Glorious Hack wrote:
[violet] wrote:Possibly fixed for update in 22 hours from now, but possibly not because I'm not really sure what's going on.

Remind me again how you got this job? :p

It was my winning personality. Now shut the hell up.

Should be fixed now. Was a dodgy setting in Apache's mod_deflate.

PostPosted: Thu May 06, 2010 5:17 pm
by [violet]
Also updated API help text.

Lemme know if there are more third-party sites you'd like added to the Examples!

PostPosted: Fri May 07, 2010 10:32 am
by The Mindset
Just to let you know that I may be pulling the allnations feed about once per week for my Nationstates Galaxy application (I don't need the nation details, I just want to check that a specific nation exists) so I dunno if that'd be sufficient reason to refrain from removing it. Alternatively, a new API call designed specifically to check if a nation exists, without any associated overhead of stats etc. (instead of having to download all nations, 99% of which I don't need) would be useful.

PostPosted: Fri May 07, 2010 2:04 pm
by Mayor For Life
W00t! Elegant resolution of the API server load quandry. William of Ockham would certainly approve.
:clap:

The data mining has already begun at the New South Hell School of NationStates Ideology.
:D

As is the predictable head scratching, bickering over unfounded hypotheses, and players staring at the data like a canary looking in a mirror.
:rofl:

PostPosted: Fri May 07, 2010 3:13 pm
by The Mindset
I'd like to note that the allnations feed seems to be broken, it stops at nation 10616 (in the mid-C's, alphabetically). It was working earlier today.

PostPosted: Fri May 07, 2010 4:25 pm
by [violet]
The Mindset wrote:Just to let you know that I may be pulling the allnations feed about once per week for my Nationstates Galaxy application (I don't need the nation details, I just want to check that a specific nation exists) so I dunno if that'd be sufficient reason to refrain from removing it. Alternatively, a new API call designed specifically to check if a nation exists, without any associated overhead of stats etc. (instead of having to download all nations, 99% of which I don't need) would be useful.

There's not much difference from our point of view between a real-time call to check if a nation exists and actually giving you all the stats on that nation.

If you only need to be doing this once a week, could you just grab nations.xml.gz Daily Dump and pull the nation names from there? Should be the same thing, just a larger download than you really need.

I probably need to convert the Name Lists to static files if we're going to keep them, due to the bug you mentioned above, but since I'm lazy if I can just drop them I will.

PostPosted: Fri May 07, 2010 4:26 pm
by [violet]
Mayor For Life wrote:W00t! Elegant resolution of the API server load quandry. William of Ockham would certainly approve.
:clap:

The data mining has already begun at the New South Hell School of NationStates Ideology.
:D

As is the predictable head scratching, bickering over unfounded hypotheses, and players staring at the data like a canary looking in a mirror.
:rofl:

Ahaha, great stuff as always!

PostPosted: Fri May 07, 2010 4:52 pm
by The Mindset
[violet] wrote:
The Mindset wrote:Just to let you know that I may be pulling the allnations feed about once per week for my Nationstates Galaxy application (I don't need the nation details, I just want to check that a specific nation exists) so I dunno if that'd be sufficient reason to refrain from removing it. Alternatively, a new API call designed specifically to check if a nation exists, without any associated overhead of stats etc. (instead of having to download all nations, 99% of which I don't need) would be useful.

There's not much difference from our point of view between a real-time call to check if a nation exists and actually giving you all the stats on that nation.

If you only need to be doing this once a week, could you just grab nations.xml.gz Daily Dump and pull the nation names from there? Should be the same thing, just a larger download than you really need.

I probably need to convert the Name Lists to static files if we're going to keep them, due to the bug you mentioned above, but since I'm lazy if I can just drop them I will.

Fair enough, whatever's best on your end!

PostPosted: Sat May 08, 2010 9:32 am
by The Mindset
The Mindset wrote:
[violet] wrote:
The Mindset wrote:Just to let you know that I may be pulling the allnations feed about once per week for my Nationstates Galaxy application (I don't need the nation details, I just want to check that a specific nation exists) so I dunno if that'd be sufficient reason to refrain from removing it. Alternatively, a new API call designed specifically to check if a nation exists, without any associated overhead of stats etc. (instead of having to download all nations, 99% of which I don't need) would be useful.

There's not much difference from our point of view between a real-time call to check if a nation exists and actually giving you all the stats on that nation.

If you only need to be doing this once a week, could you just grab nations.xml.gz Daily Dump and pull the nation names from there? Should be the same thing, just a larger download than you really need.

I probably need to convert the Name Lists to static files if we're going to keep them, due to the bug you mentioned above, but since I'm lazy if I can just drop them I will.

Fair enough, whatever's best on your end!

Actually, for what I need (nation names only) the nations.xml.gz dump has insane overhead - downloading and parsing out the useless bits pushes PHP's memory limits right to the brink and breaks completely very often. Perhaps a gz of allnations?

PostPosted: Mon May 10, 2010 8:06 am
by The Mindset
I got it working with acceptable overhead for a weekly download. However, while googling for something related to Nationstates, I noticed that Google has indexed nations.xml.gz. You might want to bar the crawler access via robots.txt in case it trawls regularly.

PostPosted: Tue May 11, 2010 12:33 am
by Jumping Jupiters
[violet] wrote:Hmm, odd. The file is not double-zipped, but it winds up that way on your computer when you download it via HTTP.


CanI ask a question, the bots that roam around on polls, what does that do for the site's benifit

PostPosted: Tue May 11, 2010 6:40 am
by North Mack
Jumping Jupiters wrote:
[violet] wrote:Hmm, odd. The file is not double-zipped, but it winds up that way on your computer when you download it via HTTP.


CanI ask a question, the bots that roam around on polls, what does that do for the site's benifit


Wow I am astounded both by the off topic-ness of that question, plus the sheer mind boggling non-sequitur of quoting that particular sentence (which has nothing to do with bots)

BUT what they do is index the site so we can do all those fancy things like search on google for a Nationstates thread. Otherwise google / yahoo / msn wouldn't know we were here at all.

PostPosted: Thu Jun 10, 2010 4:56 pm
by NewTexas
Can we pin this or something similar to this? We think developers might find it useful or at least informational.

We realize the site has been having some problems lately (read something about Apache probs). We are also wondering if you want to know about general wonkiness (ie: 421 Unused Errors on the feeds). There were a lot today!

:blink:

Edit: spelling error

PostPosted: Thu Jun 10, 2010 6:10 pm
by [violet]
NewTexas wrote:general wonkiness (ie: 421 Unused Errors

421 errors don't signify wonkiness. The API returns 421 ("Too Many Requests From Your IP Address") if you've been temporarily banned for exceeding the rate limit.

NewTexas wrote:Can we pin this or something similar to this? We think developers might find it useful or at least informational.

I'd like to put essential info on the actual API page, and that contains a link to the Technical forum. Linking to this particular thread might not be that helpful because it contains some discussion that's now obsolete.

PostPosted: Fri Jun 11, 2010 4:46 am
by NewTexas
[violet] wrote:
NewTexas wrote:general wonkiness (ie: 421 Unused Errors

421 errors don't signify wonkiness. The API returns 421 ("Too Many Requests From Your IP Address") if you've been temporarily banned for exceeding the rate limit.


:palm: D'oh, that is what that means! Ok, that explains a lot. Thank you.

PostPosted: Fri Jun 11, 2010 4:59 pm
by [violet]
Heh, you're welcome. :)

PostPosted: Tue Mar 22, 2011 4:01 pm
by [violet]
Update! API versions!

Please note the API now lets you request a particular version number, so I can upgrade it in the future without breaking everyone's scripts. There is a hopefully comprehensive explanation at http://www.nationstates.net/cgi-bin/api.cgi

I am planning to change the API format soon, so now is an excellent time to build that version parameter into your scripts!

PostPosted: Tue Mar 22, 2011 4:23 pm
by Standica
Excellent update. Thanks :)

PostPosted: Wed Mar 23, 2011 11:55 am
by Ballotonia
[violet] wrote:Update! API versions!

Please note the API now lets you request a particular version number, so I can upgrade it in the future without breaking everyone's scripts. There is a hopefully comprehensive explanation at http://www.nationstates.net/cgi-bin/api.cgi

I am planning to change the API format soon, so now is an excellent time to build that version parameter into your scripts!


For me, this link flip-flops between a 404 error, it trying to save a .cgi file on my computer, and this error:
Code: Select all
<!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Oh-oh...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1>Error!</h1><p>Sorry, NationStates has encountered an error. This problem has been logged and will be looked at shortly. If it occurs repeatedly, though, you can help us track it down by telling us what you did to reach this message. Please e-mail <a href="mailto:admin@nationstates.net">admin@nationstates.net</a>, giving this error message, the time and date it occurred, and what you were attempting to do. </p><p>Alternately, you can post this as a bug report in the <a href="http://forum.nationstates.net/viewforum.php?f=15">NationStates Technical Forum</a>. Thanks.</p><h3>Details:
</h3><pre>slurp_filename('/home/nation/public_html/cgi-bin/api.cgi') / opening: (2) No such file or directory at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 541 at /home/nation/public_html/cgi-bin/JGConfig.pm line 13
   JGConfig::__ANON__('APR::Error=HASH(0x7f5f541ac950)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 541
   eval {...} called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 541
   ModPerl::RegistryCooker::read_script('ModPerl::RegistryBB=HASH(0x7f5f542210d0)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 371
   ModPerl::RegistryCooker::convert_script_to_compiled_handler('ModPerl::RegistryBB=HASH(0x7f5f542210d0)') called at /usr/lib/perl5/ModPerl/RegistryCooker.pm line 163
   ModPerl::RegistryCooker::default_handler('ModPerl::RegistryBB=HASH(0x7f5f542210d0)') called at /usr/lib/perl5/ModPerl/RegistryBB.pm line 31
   ModPerl::RegistryBB::handler('ModPerl::RegistryBB', 'Apache2::RequestRec=SCALAR(0x7f5f541a8e58)') called at -e line 0
   eval {...} called at -e line 0
</pre>
</body>
</html>‹������MQËnÂ0¼û+¶œ)¦œ£¨*P
‡ôÐã&YK~P{C•¿¯m"Ú“÷1;³ã-6ÇuõuÚÂ[uØÃéóe¿[ÃìQÊݶz•rSmnÕb)åöcVŠ¢g£Ë¢'lcŠ5•«åŽï…¼e¢¹[Ô®ÓÀS™šñÅ¥¬z‚@þJÈ6n°LžZ@ *…5÷΃ó¨Ð8{VÝà‘•³ÕÂ,Öš€4Î\41‰Ñ
<}xQÈK;iÂ@dþÓÆÖ(«Gbççâ–?Û,™ÂÂgAeÏΛ4lÀ3   +C9˜VmšÁGs‘ðhGî•í ®Fu=CW‚ÖÙ4„ Ç\
!š¿3Ý?8O“ðä¼vC2 ¤™8j¼¢Òé3„²ÿýÝ@Úu¥ÌLjWH׿f‰FÃø��


The file contains the same message, but with different binary garbage at the end.

Ballotonia

PostPosted: Wed Mar 23, 2011 1:15 pm
by Wopruthien
Ninja'd by Ballotonia.

I get a similar message.

PostPosted: Wed Mar 23, 2011 3:01 pm
by [violet]
I had to take down the API temporarily due to our network issues. Back up now.

PostPosted: Tue Apr 05, 2011 4:36 pm
by [violet]
[violet] wrote:Update! API versions!

Please note the API now lets you request a particular version number, so I can upgrade it in the future without breaking everyone's scripts. There is a hopefully comprehensive explanation at http://www.nationstates.net/cgi-bin/api.cgi

I am planning to change the API format soon, so now is an excellent time to build that version parameter into your scripts!

As per the API documentation, the Daily Data Dumps will be getting a version number very soon!

That is, instead of looking like this:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>

<REGIONS>
<REGION>
<NAME>The East Pacific</NAME>
...
</REGIONS>

... they will look like this:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>

<REGIONS api_version="1">
<REGION>
<NAME>The East Pacific</NAME>
...
</REGIONS>


If this is going to bust your script/site, please take action now.

Also, if you haven't already built in an API version number to your Nation & Region API requests, you should do that ASAP, as they will be moving to version 2 soon.

Please post any questions! I'm happy to help with the change.

PostPosted: Fri Apr 08, 2011 7:44 pm
by Could-Not-Care-Less
Out of curiosity, are there any plans on implementing API methods to allow modifying key aspects of a nation (i.e., dealing with issues, replying to telegrams, etc.)?

Cheers.