Yahoo weather API

Hello all,

I would like to program my spark core and have it read weather from an online weather source. I’ve looked into the yahoo weather API but I am not sure how to make good use out of it. Has anyone tried to implement any sort of similar behavior like this?

Thank you!

Not yet but Raspberry Pi is very good for such kind of things!

Can the sparkcore itself call the GET routine?

I don’t think so…

It should be doable, but Yahoo uses an RSS/XML response, which could be clunky to parse on the Spark. Their sample response is 2,420 bytes of data, which can eat up a lot of RAM. Just be careful how you parse!

Yes! You can use the TCPClient class to perform an HTTP GET. There's an example there to get you started, as well as a few examples in the forum. Just search for "HTTP" or "TCPClient" to find them.

This may do what you need

1 Like

Ahh yes that us exactly what I am looking for! Thank you all so much for the help!

1 Like

I am parsing the Yahoo weather RSS feed–it is easy to parse. In my case I am pulling out the forecast for the next five days.

1 Like

Awesome, thanks guys!

Yes the Spark Core can make simple HTTP requests (GET, POST, DELETE, PUT, etc), but right now it’s difficult to call https endpoints directly from the core, something we’re working on! :slight_smile:


1 Like