NATION

PASSWORD

Script Rules Update

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Script Rules Update

Postby United Calanworie » Sun Dec 01, 2024 5:46 pm

We are looking to update the script rules in a minor fashion here to clarify HTML scripter responsibility to use the API, and this is the current proposed wording:
In a case where the API is capable of delivering the data that you are requesting (e.g. a stat query, dispatch text lookup) you must use the available API endpoint and you may not target the HTML site with a script.


If you have comments, please leave them below. There is no current timeframe for us to make this change, but any change will have a notification period and grace period attached.
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day

User avatar
Esfalsa
Spokesperson
 
Posts: 139
Founded: Aug 07, 2015
Civil Rights Lovefest

Postby Esfalsa » Sun Dec 01, 2024 6:22 pm

Where in the script rules would that be added? That would be helpful to know to contextualize this change.

Off the bat though, I think it would be better to provide greater clarity about what 'data' is being 'delivered,' as referenced in this rule. For instance:
  • I assume this is not the intention if this is meant as a 'minor' or 'clarifying' change, but I think a plain reading of this proposed wording would suggest scripts to open the issue page would become illegal? The list of what issues currently confront a nation is available on the API, but the reason why card farmers open the issues page is to answer issues on the HTML site. Unless you count the chance to earn a pack of cards as data being delivered, answering an issue on the HTML site doesn't deliver any data that answering an issue with the API doesn't also deliver. That seems... pretty major for anyone who farms cards.
  • I similarly assume this is not the intention, but in R/D, the only way 'chasing' is a viable form of gameplay is because the reports page delivers happenings in more or less real time. Technically, that data is available from the API (with multiple requests) on a 28-second delay, but I'm sure anyone in R/D can tell you that chasing on a 28 second delay is completely infeasible. On some level, this feels more pedantic than the last example, but on another level — here, it's the exact same data being delivered, and the proposed rule makes no exception if the API is capable of delivering the data you are requesting, but not with an analogous endpoint and not until after so long a delay that the data is useless.

On another note, I don't know if it needs a carve-out in the rules, but there have been situations in the past where some API functionality is perhaps well-known among certain script author communities but isn't actually documented (but hey, the RMB posting private command is documented now — thanks!). Furthermore, the API has no changelog (as far as I know, not even a standing policy to announce when a new version is live?) and I can't really discern a versioning policy from the documentation other than that "older versions may stop working without notice." I'm not trying to nitpick here or to demand semver or something, but I do assume handing out punishments for situations where the script author is reasonably unaware that the API has that functionality is not the spirit of this rule — that's distinct from fixing the script once contacted and made aware.
Last edited by Esfalsa on Sun Dec 01, 2024 6:26 pm, edited 1 time in total.

User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Sun Dec 01, 2024 6:33 pm

Esfalsa wrote:Where in the script rules would that be added? That would be helpful to know to contextualize this change.

Fair point. This would insert under "Deprecation Notice," addending the line that says "Note!! Tools that interact with the server should use the NationStates API, rather than sending commands to the HTML site."

Off the bat though, I think it would be better to provide greater clarity about what 'data' is being 'delivered,' as referenced in this rule. For instance:
  • I assume this is not the intention if this is meant as a 'minor' or 'clarifying' change, but I think a plain reading of this proposed wording would suggest scripts to open the issue page would become illegal? The list of what issues currently confront a nation is available on the API, but the reason why card farmers open the issues page is to answer issues on the HTML site. Unless you count the chance to earn a pack of cards as data being delivered, answering an issue on the HTML site doesn't deliver any data that answering an issue with the API doesn't also deliver. That seems... pretty major for anyone who farms cards.
  • I similarly assume this is not the intention, but in R/D, the only way 'chasing' is a viable form of gameplay is because the reports page delivers happenings in more or less real time. Technically, that data is available from the API (with multiple requests) on a 28-second delay, but I'm sure anyone in R/D can tell you that chasing on a 28 second delay is completely infeasible. On some level, this feels more pedantic than the last example, but on another level — here, it's the exact same data being delivered, and the proposed rule makes no exception if the API is capable of delivering the data you are requesting, but not with an analogous endpoint and not until after so long a delay that the data is useless.

Thanks for those notes. I'll have to get back to you on the first one, but as to the second, I've actually opened a PR to remove the happenings delay from the API, plus we have a SSE server in the works for happenings. Both of those should produce a result where the HTML page no longer needs to be consumed for chasing.

On another note, I don't know if it needs a carve-out in the rules, but there have been situations in the past where some API functionality is perhaps well-known among certain script author communities but isn't actually documented (but hey, the RMB posting private command is documented now — thanks!). Furthermore, the API has no changelog (as far as I know, not even a standing policy to announce when a new version is live?) and I can't really discern a versioning policy from the documentation other than that "older versions may stop working without notice." I'm not trying to nitpick here or to demand semver or something, but I do assume handing out punishments for situations where the script author is reasonably unaware that the API has that functionality is not the spirit of this rule — that's distinct from fixing the script once contacted and made aware.

Yes, I've been working slowly to improve API documentation, but I can see a good case being made here for us being more intentional about our API versioning.
Last edited by United Calanworie on Sun Dec 01, 2024 6:33 pm, edited 1 time in total.
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day

User avatar
Trotterdam
Postmaster-General
 
Posts: 10746
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Mon Dec 02, 2024 1:09 am

There should probably be a grace period when a new feature gets added to the API, because you can't expect people to update their scripts overnight. (And sometimes the feature needs debugging before it's practical to use.)

User avatar
9003
Diplomat
 
Posts: 657
Founded: Oct 25, 2012
Corporate Police State

Postby 9003 » Mon Dec 02, 2024 7:16 am

With a bigger push to get everything on the API, does the staff plan on or is their merit to having someone on the tech team specialize in the API. Specifically adding new nodes to the API or is that to niche thing.
proud member of PETZ people for the Ethical Treatment of Zombies

Active member of The cards market place discord

User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Mon Dec 02, 2024 3:41 pm

Nobody needs to specialize, as it were, in adding things to the API. That’s not a concern for us.
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day

User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Mon Dec 02, 2024 3:42 pm

Trotterdam wrote:There should probably be a grace period when a new feature gets added to the API, because you can't expect people to update their scripts overnight. (And sometimes the feature needs debugging before it's practical to use.)

Thanks, this would make sense. I’m not sure how we would word this in the script rules, but it should probably be inserted in some way.
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day

User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Thu Jan 09, 2025 6:29 am

I’m bumping this to note that with the rollout of SSE, we’re looking at this some more. Does anybody else have thoughts?
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day

User avatar
Omnicontrol
Diplomat
 
Posts: 821
Founded: Sep 03, 2021
Corporate Police State

Postby Omnicontrol » Thu Jan 09, 2025 9:24 am

Yeah, I do: I wouldn't like to see going to the HTML issues list page to answer issues instead of the API one be illegal as I (and many other card farmers) very much do not want to card farm manually
Disgruntled queer pedantic asshole.
United Calanworie wrote:Edit 2: what the actual fuck is going on here

Reventus Koth wrote:you're right guys my bad the next time i write a treaty i'll make sure to leave the possibility of raiding the other signatory on the table

All-American Confederacy wrote:I leik train :D


||||||||||||||| Trans rights are human rights.


some random native wrote:ah yes raider that absolutely massacre hundred region.

User avatar
9003
Diplomat
 
Posts: 657
Founded: Oct 25, 2012
Corporate Police State

Postby 9003 » Thu Jan 09, 2025 11:58 am

Omnicontrol wrote:Yeah, I do: I wouldn't like to see going to the HTML issues list page to answer issues instead of the API one be illegal as I (and many other card farmers) very much do not want to card farm manually



Gotissues (The script in your question) should be okay as it "harvests" the issue data via the API first to craft the custom URL that then lets the user script highlight the first option so you can press enter and breeze through.

My reading of the rule would allow this as GI, does not use the HTML to gather data and rather uses it to "print cards/answer issues" where the API would only be able to answer issues.
proud member of PETZ people for the Ethical Treatment of Zombies

Active member of The cards market place discord

User avatar
United Calanworie
Technical Moderator
 
Posts: 5177
Founded: Dec 12, 2018
Democratic Socialists

Postby United Calanworie » Thu Jan 09, 2025 5:07 pm

9003 wrote:
Omnicontrol wrote:Yeah, I do: I wouldn't like to see going to the HTML issues list page to answer issues instead of the API one be illegal as I (and many other card farmers) very much do not want to card farm manually



Gotissues (The script in your question) should be okay as it "harvests" the issue data via the API first to craft the custom URL that then lets the user script highlight the first option so you can press enter and breeze through.

My reading of the rule would allow this as GI, does not use the HTML to gather data and rather uses it to "print cards/answer issues" where the API would only be able to answer issues.

This is a correct reading. If the script is gathering the data from the API and then you are answering on the HTML page (without using a script, i.e. you are manually clicking the answer button each time) you would be in compliance with the rule.
@queerlyfe | She/Her/Hers
Getting Help Request (GHR) | One Stop Rules Shop (OSRS) | Routine Actions thread | NS Announcements Discord
Script Rules | API Documentation | Approved Image Hosts | How Bots are Regulated | NS Coders Discord

"...against all enemies, foreign and domestic..."
You are such a crybaby [...] all you do is lock threads and be a bitch to people, nobody likes you, you aren’t cool, you lock every thread for stupid reasons, often times not giving a reason, [...] all you do is sit on your computer all day on NationStates, locking threads at a rate 5x higher than any other mod [...] stop trying so hard to impress people, literally nobody like you.
Have a good day


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: A Bloodred Moon, Borkmaster, Jar Wattinree, Minbatsu, Priola, Tom, Valentine Z

Advertisement

Remove ads