Worldstate times incorrect?
When I am grabbing the data for, say, cambionCycle. It seems the timeleft value is incorrect. I may be doing something incorrectly though.
for further context, this is how I am using the API generally:
That definitely looks wrong.
You should update your node version if you're using request-promise. The fetch API is part of the default node API, and we expose this data on https://api.warframestat.us, docs: https://docs.warframestat.us.
I can't say what's up with the times on your particular system, as it seems like there's be several variables at play that I can't account for on your system. Thus why we made the rest API
Using the parser, it seems that everything but Cetus and Cambion Drift looks good. I just updated my version of node to the newest version. How would you recommend I implement the rest API as I am not super fluent in anything js. It also looks like times are fine on my system.
Screenshot of data grabbed from API:
For further even context: This is how the fetchData() function above is called and used:
replace whatever you had in fetchData with
fetch('https://api.warframestat.us/pc/?language=en').then((d) => d.json())
the above part would simplify down to....
const ws = await fetch('https://api.warframestat.us/pc/?language=en').then((d) => d.json());
const { cetusCyle: cc } = ws;
returnValue = `Cetus is currently in ${cc.state}\nTime remaining until ${cc.isDay ? 'night' : 'day'}: ${cc.timeLeft}`;
that said, i don't recommend using timeLeft in general, because it's generated when the object is generated, either way, so it's not a good way to get the timestamp, you'd be better off using moment to make a "from" timestamp, or one of the various "fromX" utilities in warframe-worldstate-data, like get the diff you need and then pass it into... https://github.com/WFCD/warframe-worldstate-data/blob/master/tools/timeDate.js#L19