To amuse myself I’ve written a script to extract the ‘current’ temperature from Met Office’s data using their API. I want to run it for a couple of days to make sure that there are no ‘bugs’ before I make it available - something went strange at midnight UTC which I am still trying to unravel. I will need to wait until at least midnight [ UTC ] tonight to ensure I have fixed the problem.
The blue coloured line is the temperature in Hereford. The date and time are my local [ +08:00 ] time and not UTC. The Met Office data is updated hourly hence the “stepped” nature of the curve. I am logging the Met Office data to v11 so as not to upset my actual recorded temperature. Hereford was just a random choice!
The PHP script will need to be run periodically [ every 5 minutes ] from a computer than runs 24 x 7 and that supports PHP script processing. The script could be modified to produce a ‘smooth’ or interpolated curve however the values could only be updated after the hour was complete - I’m not sure if this would achieve anything.
It is easy enough to register and obtain an API key. The only minor issue is that the Met Office API calls relies upon http rather than https so it is possible, although unlikely, that someone to ‘harvest’ your API key and misuse it.
N.B. The dates and times shown on the chart are my local time so 00:00 UTC corresponds to 08:00WST. I haven’t built a time machine.