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,422
Reaction score
5,133
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
184
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}
 

Latest Threads

Latest Profile Posts

I wish I can work faster on my game. But I don't want to get burned out. :(
I've been working on something on and off for a few years now, and I've been reluctant to share any details on the project before I had anything playable because I did not want to generate hype only for the project to go back on hiatus. That being said I believe what I'm working on is very unique and pushes the boundaries of what RPG Maker projects can be. Bold claims, I know but just wait.
Happy Mother's Day to all the moms :)
Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

[My favorite slow moving track I've made so far]

Forum statistics

Threads
111,207
Messages
1,059,263
Members
144,460
Latest member
fpayton
Top