Weather API not working

Charlie Carroll's icon

Hi there,

I'm trying to input London weather data into max msp however I'm really stuck on how to do this - I keep getting error messages. I have followed other peoples methods from previous forums and I'm using OpenWeatherMap to source the information. I basically just want numbers that correspond to the weather e.g temp rain wind etc so that I can the use those for effects. I've attached a patch and would be really grateful if someone was to look and suggest where I'm going wrong - maybe you know of a better source for the weather?

Thank you :)

Weather.maxpat
Max Patch

yaniki's icon

OpenWeather itself works in a simple example I prepared some time ago, so try this:

parsing_data_from_maxurl.zip
application/zip 6.81 KB

It is a simple parser: a script iterating over the dictionary created by the [maxurl]. The script generates and broadcasts set of two-element lists (key name, value) from the dictionary. These lists can be easly handled in your patches using trivial objects, such as [route], etc.

The script gives all keys unique names (naming schame is based on the original dictionary structure, so it's easy to understand) to avoid eventual problems with the keys with overlapping names nested in various parts of the dictionary.

Charlie Carroll's icon

Hi Yaniki,

That was extremely helpful I understand how the system works to get the information now. I'm just wondering whether you know of a way to get the live data in? Thanks again!

yaniki's icon

You need your own appid to access the OpenWeather API. Here you can sign up:

Charlie Carroll's icon

Thanks Yaniki - I have done that and have a working APPID but for some reason the information won't come through but will if I use the sample one. Do you have any suggestions?

Thanks again

Charlie Carroll's icon

Hi Yaniki - I've realised it is working and its printing all the information on the console however it's not showing anything through the route box.

yaniki's icon

I don't see your patch but maybe you have to adopt the content of the route object to the names of the parameters (which you can see in console).