splitting a text from a weather API

Jul 8, 2013 at 1:31pm

splitting a text from a weather API

Hi to everyone,
I’m new to the world of max and I need your help.
I collected weather data from here: http://api.openweathermap.org/data/2.5/weather?lat=10&lon=10
I’m also able to change directly in Max the latitude and longitude and collect the text with all the datas. my question is: how can I split the text to obtain the single values? (for example the temperature…). I tried to understand how the command jit.str.regexp (if it’s the right one) works but I didn’t figure out anything.
I added also my patch so maybe you can undestand better what I need.
Thanks

#255288
Jul 8, 2013 at 6:20pm

this may not be the best way to do it but seems to work:

<code>

– Pasted Max Patch, click to expand. –

</code>

#255328
Jul 9, 2013 at 1:05am

thanks! that’s the code to change latitude and longitude to obtain weather data!

<code>

– Pasted Max Patch, click to expand. –

</code>

#255345
Jul 9, 2013 at 3:48am

yes it does work– when I put my coords in where I live it said sunny and clear– I looked out the window and it was! but yes I’ve kept your patch for future use ;-]

#255367

You must be logged in to reply to this topic.