Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

UK Extremes from the MetOffice

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
duke
Posts: 840
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by duke » Mon 09 Mar 2015 7:19 pm

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.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Mon 09 Mar 2015 7:48 pm

Cookies disabled? Which browser?

User avatar
duke
Posts: 840
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by duke » Mon 09 Mar 2015 9:08 pm

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.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Mon 09 Mar 2015 9:23 pm

Odd, works in Chrome and IE for me on both my test page and my today/yesterday page...
Capture.PNG
You do not have the required permissions to view the files attached to this post.

colinpb
Posts: 86
Joined: Thu 10 Nov 2011 8:14 pm
Weather Station: VP2+SHT31+DFars+Solar+AeroCone
Operating System: Windows 10
Location: Hemel Hempstead, Hertfordshire, UK

Re: UK Extremes from the MetOffice

Post by colinpb » Mon 09 Mar 2015 9:40 pm

Firefox remembers for me (version 33.1.1. cookies enabled) My smart TV which uses linux and safari also remembers

Colin

User avatar
marfanuk
Posts: 43
Joined: Wed 06 Nov 2013 5:27 pm
Weather Station: Davis Vantage Vue
Operating System: Raspbian on the Raspberry Pi 2
Location: Nantwich, United Kingdom
Contact:

Re: UK Extremes from the MetOffice

Post by marfanuk » Tue 10 Mar 2015 12:45 pm

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.
Image
https://www.nantwich-weather.uk - Meteobridge

Darren

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Tue 10 Mar 2015 4:51 pm

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.

User avatar
duke
Posts: 840
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by duke » Tue 10 Mar 2015 7:15 pm

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
You do not have the required permissions to view the files attached to this post.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Tue 10 Mar 2015 8:44 pm

What are the cookie contents? It should just be the two character code for the selected region.

User avatar
marfanuk
Posts: 43
Joined: Wed 06 Nov 2013 5:27 pm
Weather Station: Davis Vantage Vue
Operating System: Raspbian on the Raspberry Pi 2
Location: Nantwich, United Kingdom
Contact:

Re: UK Extremes from the MetOffice

Post by marfanuk » Sat 04 Apr 2015 3:16 pm

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
Image
https://www.nantwich-weather.uk - Meteobridge

Darren

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Sat 04 Apr 2015 3:29 pm

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');

forestedge
Posts: 49
Joined: Sun 29 Jul 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

UK Extremes from the MetOffice cannot select.

Post by forestedge » Mon 17 Sep 2018 6:16 pm

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

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Mon 17 Sep 2018 7:58 pm

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.

forestedge
Posts: 49
Joined: Sun 29 Jul 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Re: UK Extremes from the MetOffice

Post by forestedge » Mon 17 Sep 2018 9:48 pm

That's really odd because it is in there checking Filezilla. Here is a copy from the server
jquery.zip
You do not have the required permissions to view the files attached to this post.

User avatar
mcrossley
Posts: 5209
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley » Mon 17 Sep 2018 10:09 pm

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.

Post Reply