Advertisement
by Poopsadon » Sat Mar 11, 2017 2:43 pm
by Trotterdam » Sat Mar 11, 2017 4:58 pm
by Poopsadon » Sun Mar 12, 2017 12:36 am
Trotterdam wrote:I don't think there is currently an API call for that. A private API shard is expected at some point in the indefinite future, but currently even the private API shards are all read-only.
Unless [violet] is willing to take the time to add that, your best option is to write a non-API script that uses the same issue-answering URL human players do. Note that non-API scripts have different rules from API-using scripts, the most important one of which (for your application) is that the ratelimit is 10 per minute instead of 100 per minute.
Note that you can make things a little easier on both your script and the server by appending /template-overall=none to the URL, for example http://www.nationstates.net/page=dilemmas/template-overall=none. I'm not sure where I learned that, the linked script rules seem to make no mention of it.
Or more topically, http://www.nationstates.net/page=enact_dilemma/dilemma=X/choice-Y=1/template-overall=none (don't click on that!), where X is the number of the issue, and Y is the internal number of the option (usually one less than the displayed number, so 0 for the first option, 1 for the second option, etc., but can be different if some options don't appear due to option validities, and -1 for dismissal).
by Imperium Anglorum » Mon Mar 13, 2017 5:17 am
https://www.nationstates.net/cgi-bin/api.cgi?wa=1&id=257&q=resolution
by Imperium Anglorum » Fri Mar 17, 2017 8:19 am
https://www.nationstates.net/cgi-bin/api.cgi?a=infoTG&tgid=(TGID)&key=(Secret Key)
by HMS Unicorn » Mon Mar 20, 2017 3:57 pm
Imperium Anglorum wrote:Also, would it be possible to have an API query which tells us what kind of telegram is being sent? Something like:
- Code: Select all
https://www.nationstates.net/cgi-bin/api.cgi?a=infoTG&tgid=(TGID)&key=(Secret Key)
Returning information on the telegram itself, like the delivery data, by whom the telegram was blocked, and what kind of telegram is being sent (recruitment, campaign, unmarked).
by Agadar » Mon Mar 20, 2017 4:11 pm
Imperium Anglorum wrote:Also, would it be possible to have an API query which tells us what kind of telegram is being sent? Something like:
- Code: Select all
https://www.nationstates.net/cgi-bin/api.cgi?a=infoTG&tgid=(TGID)&key=(Secret Key)
Returning information on the telegram itself, like the delivery data, by whom the telegram was blocked, and what kind of telegram is being sent (recruitment, campaign, unmarked).
by Imperium Anglorum » Mon Mar 20, 2017 6:42 pm
Agadar wrote:With something like that, us auto-telegrammer developers wouldn't have to rely any more on the users -possibly incorrectly- supplying the telegram type (which we need to know for the rate limits).
by Panther Ausf G » Fri Mar 31, 2017 7:07 pm
by Drachmaland » Fri May 26, 2017 6:21 am
by HMS Unicorn » Sun May 28, 2017 8:39 am
by Roavin » Mon May 29, 2017 5:51 pm
by Eluvatar » Mon May 29, 2017 6:26 pm
Drachmaland wrote:Would it be possible that NS API incorporates a new public shard to query a nation's id number?
I'm referring to the number that is currently used to resolve WA census ties in the ranking system.
HMS Unicorn wrote:Request
Would it be possible to add a shard providing the most recent date a nation joined the WA (or, say, 0 if the nation is not a member)?
This would be very helpful for various regional surveys we conduct in TNP and Europeia, to try to improve our WA membership rates.
I understand that the utility of this is relatively limited, but if this is something the game already tracks and can be easily added to the API, it would be very convenient. Otherwise, I can get this information from elsewhere.
Thanks!
Roavin wrote:Request
Is there a way to make the happenings shard easier to parse and store? At the moment, only the <TEXT> tag is included, and script authors relying on happenings must manually parse that text. While parsing out nations/regions are easy due to the use of tags with their canonical name (so we can just regex-match), other things are not so easy. Useful tags may be:
- <REGION> - self-explanatory, optional
- <NATION> - self-explanatory, optional
- <TYPE> - This could be one of the filter types (law, cte, etc., or "other" for custom happenings)
- <ISSUE_ID> - If this is a law happening, the ID of the issue that was answered
- <ISSUE_ANSWER> - If this is a law happening, which answer was given for that issue
- <INFLUENCE> - for Influence rank changes, from and to
- ...etc...
I store happenings in a database, currently with a TEXT column plus pre-parsed region1, region2, nation1, nation2 columns for search. I intend to expand that to include at least the type, and possibly modify it so that when it's unambiguous, the text column is just NULLed to save space in the database. Besides, it just makes it easier to search in the DB in general - I can build indices, do funky joins, what have you.
by Caelapes » Mon May 29, 2017 6:31 pm
Eluvatar wrote:Drachmaland wrote:Would it be possible that NS API incorporates a new public shard to query a nation's id number?
I'm referring to the number that is currently used to resolve WA census ties in the ranking system.
It would certainly be possible. As [v] and I don't see a problem with doing it, it'll probably be done soon.
by [violet] » Tue May 30, 2017 10:16 pm
by Roavin » Wed May 31, 2017 1:36 am
Eluvatar wrote:A concern is that such a form for the happening would be considerably longer. Anyone saving the raw XML would not be pleased by the replacement of <TEXT>...</TEXT> with all of this info, presumably in addition to the TEXT.
This would also not be fun to implement. It's not happening in the foreseeable future.
[violet] wrote:The API doc has been updated with instructions on how to answer issues via API. This is the first "Private Command" where you can actually make your nation do stuff via the API, not just gather information about it.
Feedback welcome!
by Greater Tern » Wed May 31, 2017 5:33 am
[violet] wrote:The API doc has been updated with instructions on how to answer issues via API. This is the first "Private Command" where you can actually make your nation do stuff via the API, not just gather information about it.
Feedback welcome!
by [violet] » Wed May 31, 2017 6:20 pm
Roavin wrote:Nice! An example for the different generated responses may be nice, since the "live" example obviously won't work with just a click.
Roavin wrote:Does one-click-one-action apply here, or would it be permissible to create an "automated issue answering" tool?
Greater Tern wrote:The only issue I'd like to point out is that this should probably be a POST command, rather than just GET.
Greater Tern wrote:Out of curiosity, what does the RECLASSIFICATIONS schema look like?
<RECLASSIFICATIONS>
<RECLASSIFY type="govt">
<FROM>Inoffensive Centrist Democracy</FROM>
<TO>Iron Fist Consumerists</TO>
</RECLASSIFY>
<RECLASSIFY type="0">
<FROM>Some</FROM>
<TO>Few</TO>
</RECLASSIFY>
<RECLASSIFY type="2">
<FROM>Some</FROM>
<TO>Few</TO>
</RECLASSIFY>
</RECLASSIFICATIONS>
by Greater Tern » Wed May 31, 2017 7:11 pm
by Flanderlion » Thu Jun 01, 2017 4:26 am
[violet] wrote:The API doc has been updated with instructions on how to answer issues via API. This is the first "Private Command" where you can actually make your nation do stuff via the API, not just gather information about it.
Feedback welcome!
Advertisement
Users browsing this forum: Riemstagrad, Tiami
Advertisement