• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GM2 getting HTML/HTTP information on a website

chamaeleon

Member
Hello, I am currently working on a game which requires it to know if the stock market is currently open or not, It needs to go to https://www.stockmarketclock.com/exchanges/nyse/trading-hours and check if the Exchange is open or closed. Iv seen that this may be possible with http_Get but i have no idea where to go, any ideas?
Use the API provided (https://www.stockmarketclock.com/pricing, https://www.stockmarketclock.com/api-documentation.html#stockmarketclock-api), as querying the website would presumably get your game blocked if the abuse is detected. And needless to say, given that the API is not free and requires a key, you should use as server of your own that query the API, instead of embedding the key in your game so that anyone can pick it out and use the API while you pay for it.
 
H

Homunculus

Guest
Opening hours and days are set, why do you need to get this information live from the website to begin with?

With http_get you can download the html code of the page, but seeing how the clock works, it probably won't be of any help since that is probably dynamically generated with JS.

A better solution (other than hardcoding the opening hours) is to use an API as @chamaeleon suggested.
 
Top