Page 1 of 1
Webtag for this date a year ago
Posted: Sat 30 Mar 2013 10:24 pm
by mikechristelow
I recently added a line to my indexT "current conditions" entry which shows "Today is/was, on average, 0.6°C warmer/cooler than yesterday." It reads present tense whilst the station is in daylight and past tense after dark and displays warmer or cooler according to, er, whether it's warmer or cooler

.
What I'd like to do is enhance this to show "Today was, on average, 0.6°C warmer than yesterday and n.n°C warmer/cooler than the same date a year ago."
Does anyone have a mechanism or suggestions how to do this? I'm using HTML only...
Cheers!
Re: Webtag for this date a year ago
Posted: Sun 31 Mar 2013 10:11 am
by steve
It's something that I may add to Cumulus at some point. Currently you can only get figures going back a week; extending this to a year will take some thought to make accessing it efficient, like an SQL database. To do it yourself you will probably need to copy all of your Cumulus data into a database on your web site; but someone else may have other suggestions.
Re: Webtag for this date a year ago
Posted: Sun 31 Mar 2013 11:52 am
by mikechristelow
Thanks Steve, I realised after posting that I'd only explicitly referred to temperature (and implicitly an average temperature at that). I imagine though there may be many who'd like to be able to show a comparison of today against the same date a year ago for any particular value...Mike
Re: Webtag for this date a year ago
Posted: Mon 01 Apr 2013 7:10 pm
by sfws
steve wrote:To do it yourself you will probably need to copy all of your Cumulus data into a database on your web site; but someone else may have other suggestions.
See an old posting
https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=8631 Post subject: Comparing with one year ago
This included a javascript alternative using an uploaded 'dayfile.txt'. (Just to explain, I currently have intermittent broadband, do not have any website, and only intermittently use a obsolete build of Cumulus so I don't use what I produced any more).
Re: Webtag for this date a year ago
Posted: Mon 01 Apr 2013 8:38 pm
by mikechristelow
Thanks Steve - this looks very promising! I'll investigate the details on the previous post and see how I can on.
All the best,
Mike
Re: Webtag for this date a year ago
Posted: Sat 06 Apr 2013 9:31 pm
by mikechristelow
Hi Steve,
After some really useful pointers from Francis (sfsw) I have it working. Turned out the script was expecting to find my dayfile.txt in the root directory but I actually have it in a subdirectory "/data" in support of DAJ's monthly records feature. As I admitted to Francis, I feel rather foolish now
Anyway, the result so far is
here
I just need to work out how to meet my original requirement which is to show today's average temperature adjacent to the average temperature for the same day a year ago. One step at a time
Mike