Month: September 2014

Using openweathermap api – part 2

In part 1 we learned how to use endpoint to read current weather and forecast in browser and now lets make a python package.

But just before lets make few points.

  • Our reader should work in background as thread,
  • Have ability to read data for few cities
  • Read data not in real time but with some frequency

Why ?
Simple, we don’t want to send requests to openweathermap server with each call. It would be lame. Lets imagine that main loop is reading and displaying weather each second (on nice 20×4 LCD). Doing each second a call to remote server would take ages (ok few ms but way to long 🙂 ). We are asking for data and we want it now. And what is also important data wont change so often. We don’t need to have a fresh packet from server.

(more…)