Page 2 of 3

Re: UK Extremes from the MetOffice

Posted: Mon 09 Mar 2015 7:19 pm
by duke
mcrossley wrote:
duke wrote:Mark, just a thought, is it possible to store the selected region in a cookie so a returning visitor automatically sees their last choice? Presumably in most cases this would be the region they live in.
What, like this?: http://weather.wilmslowastro.com/test/t ... mes24h.php
Doesn't work for me, if I select London & SE from your drop down and then return to the page later it displays UK and not my London & SE.

Re: UK Extremes from the MetOffice

Posted: Mon 09 Mar 2015 7:48 pm
by mcrossley
Cookies disabled? Which browser?

Re: UK Extremes from the MetOffice

Posted: Mon 09 Mar 2015 9:08 pm
by duke
mcrossley wrote:Cookies disabled? Which browser?
Sorry Mark, ok, using WaterFox/FireFox with cookies enabled. I'm not even seeing a cookie for your site in the list. Also just tried with IE and Chrome with similar result.

Re: UK Extremes from the MetOffice

Posted: Mon 09 Mar 2015 9:23 pm
by mcrossley
Odd, works in Chrome and IE for me on both my test page and my today/yesterday page...
Capture.PNG

Re: UK Extremes from the MetOffice

Posted: Mon 09 Mar 2015 9:40 pm
by colinpb
Firefox remembers for me (version 33.1.1. cookies enabled) My smart TV which uses linux and safari also remembers

Colin

Re: UK Extremes from the MetOffice

Posted: Tue 10 Mar 2015 12:45 pm
by marfanuk
I've fiddled for ages to try and get the extremes script to work, but with no success.

Heres my link to the script - http://www.nantwich-weather.co.uk/ukExtremes24h.php

My settings -

Code: Select all

class ukExtremes24h {

    // Data Source
    private $urlBase = 'http://datapoint.metoffice.gov.uk/public/data/txt/wxobs/ukextremes/json/';
    private $apiKey = '2a7383b4-52a6-4c81-a0b8-77795464f1af';              // Your Met Office DataPoint API key
    private $cachePath = 'cache';   // Cache directory without trailing slash

    private $cacheFile = 'ukExtremes24h.json';              // Cache file name
    private $cacheTime  = 3600;                             // Cache expiration time Default: 3600 seconds = 1 Hour
    private $logging = true;                                // Logs information messages as comments in your HTML

    private $rawData = array();                             // Used internally to hold status and raw DataPoint data
    private $cache = 'cache';                                    // Used internally to hold full cache file name
also Mark met office weather forecast script is looking good, look forward to trying it.

Re: UK Extremes from the MetOffice

Posted: Tue 10 Mar 2015 4:51 pm
by mcrossley
Hi Darren, nothing is being sent back to the browser, so you need to check the php error log on your server to see what is going on.

Re: UK Extremes from the MetOffice

Posted: Tue 10 Mar 2015 7:15 pm
by duke
mcrossley wrote:Odd, works in Chrome and IE for me on both my test page and my today/yesterday page...
I have the cookie in Chrome and FireFox but it does not remember my choice.
wilm_cookie.png

Re: UK Extremes from the MetOffice

Posted: Tue 10 Mar 2015 8:44 pm
by mcrossley
What are the cookie contents? It should just be the two character code for the selected region.

Re: UK Extremes from the MetOffice

Posted: Sat 04 Apr 2015 3:16 pm
by marfanuk
mcrossley wrote:Hi Darren, nothing is being sent back to the browser, so you need to check the php error log on your server to see what is going on.
Hi Mark, bit of a delay in replying to You.

I've now got logging activated by my ISP and this is what i get back:

Code: Select all

88.104.86.206 - - [04/Apr/2015:16:06:08 +0100] "GET /ukExtremes24h.php HTTP/1.0" 200 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"
It means nothing to Me. Any ideas?

http://www.nantwich-weather.co.uk/ukExtremes24h.php

Re: UK Extremes from the MetOffice

Posted: Sat 04 Apr 2015 3:29 pm
by mcrossley
Hi Darren, it looks like that is the HTTP access log from the web server, you need the error log to see if anything is going wrong in PHP.

You can try adding the following lines to the top of the PHP script - just after the "<?php" line. The problem is they may not show anything if the script is failing to parse/compile for some reason.

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', '1');

UK Extremes from the MetOffice cannot select.

Posted: Mon 17 Sep 2018 6:16 pm
by forestedge
I have the test script for UK extremes working for UK and region SE England here. http://www.tottonweather.co.uk/testUkExtremes24h.phpHowever when a region is selected from the dropdown box nothing happens!
This was the case with the original download.

Is some further coding needed here? Any help appreciated. :D

Re: UK Extremes from the MetOffice

Posted: Mon 17 Sep 2018 7:58 pm
by mcrossley
Your page is missing the jquery script. It has...

Code: Select all

<script src="public_html/js/jquery.js" type="text/javascript"></script>
but jquery.js is not found on your server.

Re: UK Extremes from the MetOffice

Posted: Mon 17 Sep 2018 9:48 pm
by forestedge
That's really odd because it is in there checking Filezilla. Here is a copy from the server
jquery.zip

Re: UK Extremes from the MetOffice

Posted: Mon 17 Sep 2018 10:09 pm
by mcrossley
I'm on my phone so can't easily check things, but I suspect you need to remove the "public_html" bit from the URL.