Retrieving data from web JSON

tsnyder0928

Warper
Member
Joined
Jul 29, 2013
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Hi all,


I am trying to get input from a web server to fill a variable in my game.


What I am doing is setting the current weather in my game to the current local weather of the user.


I am using openweathermap.org and the data is returned as JSON formatted data.


How can I get the game to us the API call to get the data and parse the JSON into java script variables for my use?  I have been trying to figure this out but don't know where to start.


Here is an example of the API call.


I have removed the actual APPID because I am limited on how many I can use a day, so this link will not work.


api.openweathermap.org/data/2.5/weather?zip={44614},{us}&APPID=


Here is an example of the result:Example API JSON RESPONSE.PNG


Thank you in advance for any help you might be able to give.
 

taarna23

Marshmallow Princess
Global Mod
Joined
Jul 20, 2012
Messages
2,402
Reaction score
4,966
First Language
English
Primarily Uses
RMMZ
I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.


@tsnyder0928 What you are attempting to do will require a JavaScript plugin to parse the data into a usable format.
 

Skotty TV

Veteran
Veteran
Joined
Nov 4, 2015
Messages
98
Reaction score
177
First Language
German, English
Primarily Uses
can you pls paste the outcome as text not as an image.


Because i need to register to get this information...


Your Link gives me this:

Code:
{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
 
Last edited by a moderator:

tsnyder0928

Warper
Member
Joined
Jul 29, 2013
Messages
2
Reaction score
0
First Language
English
Primarily Uses
Code:
{"coord":{"lon":-81.57,"lat":40.94},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":291.29,"pressure":1028,"humidity":27,"temp_min":290.15,"temp_max":292.15},"visibility":16093,"wind":{"speed":2.1,"deg":36.0113},"clouds":{"all":1},"dt":1478465100,"sys":{"type":1,"id":2190,"message":0.0145,"country":"US","sunrise":1478433872,"sunset":1478470493},"id":5161693,"name":"Manchester","cod":200}
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top