Author Topic: UK extremes script  (Read 1089 times)

0 Members and 1 Guest are viewing this topic.

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
UK extremes script
« on: March 18, 2016, 03:06:03 PM »
Hi,
just recently I noticed on the WD forum some people were having problems with a script that shows UK extreme data.

Since I just created a plugin for my template, I thought it might be useful to make a stand-alone version, which would only contain the absolute basic table with data for UK and your region so that you can then modify it any way you like and integrate into any existing webpage.

The main advantage of this script is that it uses the MetOffice API and JSON output, which is much more reliable and also faster than using HTML scraping, which often causes problems and is very slow.

In the actual file (instructions included in the code), you just specify your API key (which you can get for free), cache time and abbreviation of your desired region. (all instructions in the code).

You can copy the PHP to any site and there is a very simple table generated just to show you how to get the output.

Example:
http://www.meteotemplate.com/templateTest/extremes.php

If anyone is interested feel free to use it.

Jachym

Offline jeffm5690

  • Forecaster
  • *****
  • Posts: 310
    • Long Island New York Weather
Re: UK extremes script
« Reply #1 on: March 19, 2016, 12:25:46 AM »
You are always on top of things!  Great work! 

Jeff

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: UK extremes script
« Reply #2 on: March 19, 2016, 05:19:19 AM »
Jeff,  but you use meteotemplate so I suggest you use the plugin,  not this stand alone script,  this is only an example to be included on any page and modified to fit the design of it