Page 1 of 1

Need to identify web template in use

Posted: Wed 08 Aug 2018 12:45 pm
by clubview
Hello, I'd really appreciate this community's help with identifying which web template/script has been used to embed live station data on a client's website.

The data file cumulus/realtimegauge.txt is still being successfully uploaded by Cumulus (v1.9.4) via FTP, but the live gauges stopped working after the website was upgraded from HTTP to HTTPS. This is because the javascript is making an 'AJAX' request to fetch the data from the non-HTTPS website.

The page in question is https://www.ryegolfclub.co.uk/weather/ and the code that loads the gauges is as follows:

Code: Select all

<p id="gauges-container"></p>
<script type="text/javascript" src="/files/478/_ftp_/gauges/script.js"></script>
<script type="text/javascript" src="/files/478/_ftp_/gauges/template.js"></script>
The console error in the browser is as follows:
Mixed Content: The page at 'https://www.ryegolfclub.co.uk/weather/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.ryegolfclub.co.uk/files/478/ ... 3730644774'. This request has been blocked; the content must be served over HTTPS.
If I drop the same code into an entirely different website it still requests data from the old HTTP URL, from which I deduce that the URL of the live data file must be contained in the gauges/script.js file. The code in that javascript file is obfuscated, however, so I cannot simply edit it to fix the problem.

Despite spending some time Googling and checking this forum, I have been unable to work out which of the various web scripts/templates is being used. I was hoping that a member of this forum would recognise the gauges or embed code, and perhaps know how I can re-generate the gauges/script.js with the current (i.e. HTTPS) URL for the data file.

Thanks in advance for any help.

Re: Need to identify web template in use

Posted: Wed 08 Aug 2018 2:27 pm
by mcrossley
gauges.js is supplied in an un-minimised form, and the AJAX call uses a relative URL by default so should "just work" when changing from HTTP to HTTPS. It sounds like your client has modified the file and minimised it

Re: Need to identify web template in use

Posted: Thu 09 Aug 2018 1:20 pm
by clubview
gauges.js is supplied in an un-minimised form
Hello, Mark, thanks for your reply, however gauges.js is not one of the files used on the client's page, and would be very surprised if the person/people who set this up would have renamed the files or put the code through a js 'minifier'. As far as I know there was nobody involved who would even go out of their way to modify javascript code, let alone know what a minifier was!

There are three scripts/templates that have their own forums here: Saratoga, SteelSeries Gauges and Weather By You. I assume you think the page in question is using SteelSeries Gauges, yes? Doing some more digging I can see that it certainly matches visually, but the implementation details look different (different js file names), so I wonder there might be a third-party bit of software that reuses the SSG front end with different javascript?

Alternatively, rather than trying to fix what's there now, as long as there is a cumulus/realtimegauge.txt file still being refreshed automatically by Cumulus should I just be able to set up SSG from scratch (and dump the old code that was there before)?

Many thanks again for any help or pointers!

Re: Need to identify web template in use

Posted: Thu 09 Aug 2018 2:10 pm
by water01
Mark is the author of SteelSeries Gauges and on looking at the site those are definitely Marks gauges.

No reason why you could not down load them and implement them in place of the existing gauges. Make sure you use the latest realtimeguages.txt in the download as each one is linked to a particular version of the code.

Re: Need to identify web template in use

Posted: Thu 09 Aug 2018 3:14 pm
by mcrossley
The code is definitely the SS gauges, but the source has been encoded. The file https://www.ryegolfclub.co.uk/files/478 ... /script.js has encoded at least the following files into a single file, which it dynamically decodes on page load:
gauges.js, steelseries.js, tween.js, language.js

Even the HTML is saved into a JavaScript variable, then written out to the containing DIV :?

Sounds like it was done by someone with some decent knowledge - or access to a tool they didn't understand!

Re: Need to identify web template in use

Posted: Thu 09 Aug 2018 4:30 pm
by steve
Forgive me for asking what seems to me to be an obvious question, but why do the owners of the web site not know what they are using on their web site?

Re: Need to identify web template in use

Posted: Fri 10 Aug 2018 9:50 am
by clubview
steve wrote:Forgive me for asking what seems to me to be an obvious question, but why do the owners of the web site not know what they are using on their web site?
Entirely fair question! The data upload from Cumulus and the code that embeds the gauges on the website were set up by a third party who was asked to help. That person is not technical though, which is why I don't believe they would have modified or minified the code. That's why I suspect they instead used some tool that prepared a single compressed & obfuscated js file based on values entered into some programme/wizard.

Re: Need to identify web template in use

Posted: Fri 10 Aug 2018 6:40 pm
by water01
Still think the best option is download the latest version from here https://cumulus.hosiene.co.uk/viewtopic.p ... 186#p61199 and implement it in place of the existing gauges.

Re: Need to identify web template in use

Posted: Fri 10 Aug 2018 8:17 pm
by clubview
mcrossley wrote:Sounds like it was done by someone with some decent knowledge - or access to a tool they didn't understand!
I think it was most likely the latter, Mark! Thanks for giving this your attention and verifying that it is definitely based on your code though.
water01 wrote:Make sure you use the latest realtimeguages.txt in the download as each one is linked to a particular version of the code.
Sorry, not sure what you mean - I'm a web developer with no knowledge of Cumulus or weather stations before this, so it's all completely new to me!

I've looked in the SSG Github repository and there's a realtimegaugesT.txt file - does that act as a template used by Cumulus when it uploads data then? I had assumed that the realtimegauge.txt file was something intrinsic/built-in to Cumulus.

Thanks in advance (yet again!),
James

Re: Need to identify web template in use

Posted: Fri 10 Aug 2018 10:17 pm
by water01
If you download the latest complete ZIP file it contains a file called realtimegaugesT.txt plus all the other files needed to implement the SteelSeries Gauges.

Cumulus version 1.9.4 version 1099 is the latest and last version of Cumulus 1 which is what you are running which connects to the weather station (not sure which model they have but they will know) and gets data from it. Cumulus on a regular basis uploads the Template files (all have a capital T following their name i.e. indexT.htm) and after they have been processed by Cumulus (this means all the #web tags are replaced with the actual data obtained from the weather station) it uploads the file and renames it without the T (i.e. indexT.htm becomes index.htm etc. etc.).

Mark kept this as the standard when he built the SS Gauges so realtimegaugesT.txt becomes realtimegauges.txt on upload after it has been processed by Cumulus. Now realtimegaugesT.txt is not part of the standard uploaded files that Cumulus uploads, so someone at some time added it to the extra files area to be uploaded in Cumulus, giving it the realtimegaugesT.txt as the local file name, realtimegauges.txt as the renamed file on the server, and telling Cumulus to process it which is why it ends up like this on you server.

Code: Select all

{"date":"10:24","temp":"16.8","tempTL":"12.8","tempTH":"17.0","intemp":"22.0","dew":"13.6","dewpointTL":"11.3","dewpointTH":"13.8","apptemp":"15.4","apptempTL":"12.6","apptempTH":"16.6","wchill":"16.7","wchillTL":"12.8","heatindex":"16.8","heatindexTH":"17.0","humidex":"19.8","wlatest":"7.0","wspeed":"8.0","wgust":"12.0","wgustTM":"19.0","bearing":"348","avgbearing":"335","press":"1019.54","pressTL":"1019.07","pressTH":"1020.05","pressL":"969.05","pressH":"1043.79","rfall":"0.0","rrate":"0.0","rrateTM":"0.0","hum":"81","humTL":"80","humTH":"93","inhum":"54","SensorContactLost":"0","forecast":" Mostly clear with little temperature change. ","tempunit":"C","windunit":"mph","pressunit":"mb","rainunit":"mm","temptrend":"+0.5","TtempTL":"00:41","TtempTH":"10:10","TdewpointTL":"00:37","TdewpointTH":"08:57","TapptempTL":"00:41","TapptempTH":"10:10","TwchillTL":"00:41","TheatindexTH":"10:10","TrrateTM":"00:00","ThourlyrainTH":"00:00","LastRainTipISO":"2018-06-01 17:30","hourlyrainTH":"0.0","ThumTL":"10:12","ThumTH":"01:18","TpressTL":"02:22","TpressTH":"00:03","presstrendval":"0.00","Tbeaufort":"F3","TwgustTM":"00:29","windTM":"8.0","bearingTM":"266","timeUTC":"2018,7,11,9,24,31","BearingRangeFrom10":"290","BearingRangeTo10":"010","UV":"0.0","SolarRad":"0","CurrentSolarMax":"727","version":"1.9.4","build":"1099","ver":"7"}
It is this file that gauges.js picks up and uses it to produce the realtime gauges on their website but because it is blocked is doesn't get the data.

So your task, should you choose to accept it :D :D is to implement the latest version of the gauges which will allow you to fix the gauges.js to pick up the right data once you have got the new realtimegaugesT.txt uploading correctly. It also looks as though it is an old version of SS gauges as there are now 9 gauges and a cookie selector to set how measurements are displayed (i.e. mm or inch of rain etc.)

Hope that helps!!

Re: Need to identify web template in use

Posted: Fri 10 Aug 2018 10:30 pm
by water01
As an additional point I took another look at the Rye Golf Club page and clicked on
To see the historical data of our weather station, click here
and rather than seeing what I expected a complete set of Cumulus web pages displaying all the data since the station was set up to use Cumulus, it directed me to the Weather Underground web site for ICAMBER6, which is still being updated by the weather station. It is a bit of a cop out since all the history must be being held on the computer they are using and could be displayed by the Cumulus web pages and makes a better job of it than WU!! Personal opinion!!