An example I just wrote and wanted to share

  • 1
  • Idea
  • Updated 4 years ago
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:

What do you think?
Photo of flapane


  • 5 Posts
  • 1 Reply Like
  • happy

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Thanks for sharing!
Photo of 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

Here's a screenshoot:
Here's a live demo:

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