API Update Interval

You have questions? We may have answers.

Moderators: Forum Moderators, Active DMs

Post Reply
Cihparg
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 688
Joined: Sat Nov 15, 2014 4:32 pm
Location: Matrix, @bullish0576:mozilla.org

API Update Interval

Post by Cihparg » Thu Jan 08, 2015 4:26 pm

Is there any preferred interval to how often we're allowed to request new information from the API?
I've currently set up a script that requests new JSON every 5 seconds.

Can I go lower? I'd like something along the lines of 1-2 seconds, but would that be too taxing?
If 5 seconds is still too low, how much should I increase the interval?

User avatar
IndifferentPerson
Posts: 649
Joined: Mon Sep 08, 2014 1:46 am
Location: 44th most violent city in the world.

Re: API Update Interval

Post by IndifferentPerson » Thu Jan 08, 2015 4:54 pm

i cant be the only one who has no idea what those acronyms mean

Cihparg
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 688
Joined: Sat Nov 15, 2014 4:32 pm
Location: Matrix, @bullish0576:mozilla.org

Re: API Update Interval

Post by Cihparg » Thu Jan 08, 2015 5:05 pm

The API just gives information about the server - online players, server status, amount of members and such. Available in both XML and JSON.

http://portal.arelith.com/api/json for JSON, and ...
http://portal.arelith.com/api/xml for XML.

Add /server or /server/state to get more information from the API, than just the directive.

I believe the Portal uses the API as well, seeing that it uses most if not all information from it.
(And that's also the directory for the API, so probably yes.)

What_Evil_Lurks
Arelith Supporter
Arelith Supporter
Posts: 188
Joined: Mon Sep 08, 2014 12:41 pm

Re: API Update Interval

Post by What_Evil_Lurks » Fri Jan 09, 2015 3:39 am

I am a noob I guess. Why on earth would you need to have server info updated that often?
RED GANOT wrote:STEP 1: Stop being scared of conflict.

User avatar
High Primate
Posts: 800
Joined: Thu Sep 11, 2014 5:25 pm

Re: API Update Interval

Post by High Primate » Fri Jan 09, 2015 3:41 am

JSON, API ORLY? FRG, PHP OMG? TY! K THX BI.

(SRRY, JK.)
Some builds I've worked on (not recommended):
Charisma Battlecleric
"E-Dodge Brycer"

Erin Greene
Arelith Supporter
Arelith Supporter
Posts: 167
Joined: Tue Sep 30, 2014 9:12 pm

Re: API Update Interval

Post by Erin Greene » Fri Jan 09, 2015 3:42 am

Toooooo many acronyms, my brain hurts.

Cihparg
Arelith Silver Supporter
Arelith Silver Supporter
Posts: 688
Joined: Sat Nov 15, 2014 4:32 pm
Location: Matrix, @bullish0576:mozilla.org

Re: API Update Interval

Post by Cihparg » Fri Jan 09, 2015 2:11 pm

What_Evil_Lurks wrote:I am a noob I guess. Why on earth would you need to have server info updated that often?
Getting last seen dates and whether or not players are online.
* The API does not deliver last seen dates, and doesn't have offline users - therefore I cache every player that pops up online, and track their "lastseen" as long as they're online. Gives a pretty decent estimate on when they've been last online, if they disappear from the API's list.

Beep boop.


Post Reply