An example I just wrote and wanted to share

  • 1
  • Idea
  • Updated 5 years ago
Hi,
I wrote a PHP script with cache file I wanted to share with you.
It retrives temperature values of a number of personal stations.
The output (with 2 pws, in this case) is something like:
27.1°C (Napoli-Posillipo) | 29°C (Stadio San Paolo di Napoli, Napoli) | 28.05°C (average) | 14m39s ago

Here's the code: http://snipt.net/flapane/use-wundergr...

What do you think?
Photo of flapane

flapane

  • 5 Posts
  • 1 Reply Like
  • happy

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 123 Reply Likes
Thanks for sharing!
Photo of flapane

flapane

  • 5 Posts
  • 1 Reply Like
Hi there,
I improved the script by adding (optional, it works only if expressely activated in the configuration) today's forecast, and lowering the cache time from 30 to 60 minutes (in order to avoid too much API calls per day. With 2 stations and forecasts activated, it's 72 calls per day).
Language can be changed in the config section of the script. By default it's set to Italian (IT).
In the next hours I'll update the source code at http://www.flapane.com/blog/2013/02/h...

Here's a screenshoot: http://i.imgur.com/z7E2LeO.png
Here's a live demo: http://www.flapane.com/wunder_temp.php

As usual, feedback from users and from you WU employees is appreciated, I coded it just as a hobby. :)