Forums > MaxMSP

splitting a text from a weather API

July 8, 2013 | 1:31 pm

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


July 8, 2013 | 6:20 pm

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

<code>

– Pasted Max Patch, click to expand. –

</code>


July 9, 2013 | 1:05 am

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

<code>

– Pasted Max Patch, click to expand. –

</code>


July 9, 2013 | 3:48 am

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 ;-]


Viewing 4 posts - 1 through 4 (of 4 total)