Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

UK Extremes from the MetOffice

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

Moderator: daj

duke

Re: UK Extremes from the MetOffice

Post 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.
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley »

Cookies disabled? Which browser?
duke

Re: UK Extremes from the MetOffice

Post 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.
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley »

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 »

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 »

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: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post 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.
duke

Re: UK Extremes from the MetOffice

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post by mcrossley »

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 »

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: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post 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');
forestedge
Posts: 104
Joined: Sun 29 Jul 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus DFARS
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

UK Extremes from the MetOffice cannot select.

Post 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
User avatar
mcrossley
Posts: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post 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.
forestedge
Posts: 104
Joined: Sun 29 Jul 2012 11:46 am
Weather Station: Davis Vantage Pro2 Plus DFARS
Operating System: Windows 10 64 bit
Location: Ashurst Bridge, Hampshire UK
Contact:

Re: UK Extremes from the MetOffice

Post by forestedge »

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: 12641
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: UK Extremes from the MetOffice

Post 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.
Post Reply