Trixology

WeatherCat => WeatherCat Integration => Topic started by: Alan Rowley on July 28, 2015, 07:52:29 AM

Title: Adding stats to website
Post by: Alan Rowley on July 28, 2015, 07:52:29 AM
I know how to get individual files on to my custom website, but is there any script that can load all the daily, monthly and yearly reports to my site and then display them? I have seen others have done this, but I've not found a way, other than loading them all individually and creating a webpage for each month with dropdown menus to select the days, months and years.

Can this be done automatically?
Title: Re: Adding stats to website
Post by: Steve on July 28, 2015, 05:37:55 PM
Alan, are you referring to the statistics as shown HERE (http://www.avon-weather.com/statistics.html) on my web page? If so, here are the tags for your template:

Historical Weather for L$
Last update: D$
STRECORDS$
STRECENT$
ST1$

I hope that helps,
Steve
Title: Re: Adding stats to website
Post by: Alan Rowley on July 28, 2015, 05:47:44 PM
Thanks Steve, I had just seen those tags and I will be using them when I design a stats page. I was thinking more of the daily and monthly reports. Tonight, there will be a report produced for the 28th, and the July monthly report will be updated. It's really the July one, and the 2015 one, which I would like to use on my site.

ALAN.
Title: Re: Adding stats to website
Post by: JosBaz on July 28, 2015, 06:59:47 PM
Maybe I'm missing the point (happens more often at my age) but the below tags give you this on your site:
STNOAAMO$ gives you this month's NOAA report
STNOAAYR$ gives you this year's NOAA report

In addition you can add:
STNOAAPRMO$ gives you last month's NOAA report
STNOAAPRYR$ gives you last year's NOAA report

Jos
Title: Re: Adding stats to website
Post by: Randall75 on July 28, 2015, 10:26:31 PM
Hi Alan
 
I have daily,yesterday,weekly,monthly, and yearly stats on my web site


Highest temperature today = 89.0?F at 3:54 PM
[/l]

Lowest temperature today = 65.6 ?F at 6:45 AM
Highest dewpoint today = 72.8 ?F at 2:27 PM
Lowest dewpoint today = 61.9 ?F at 6:23 AM
Highest external humidity today = 90 % at 7:01 AM
Lowest external humidity today = 47 % at 3:42 PM
Highest heat index today = 95.6 ?F at 2:27 PM
Lowest wind chill today = 65.6 ?F at 6:45 AM
Highest pressure today = 29.97 inHg at 9:06 AM
Lowest pressure today = 29.91 inHg at 5:17 PM
Highest wind speed today = 11 MPH at 12:34 PM
Wind run today: 11.43 Miles
Average wind direction today = 67 degrees
Highest rain rate today = 0.00 in/h at 5:01 PM
             Rain Total today = 0.00 in         
is this what you are looking for
cheers
[cheers1]
Title: Re: Adding stats to website
Post by: Alan Rowley on July 28, 2015, 10:43:21 PM
I think I'm looking for something that doesn't exist Randy. I'm looking for a script that will upload the daily, monthly and yearly reports and then display them on a page on my site.

This is what I could do on my old Weather Display set-up - http://www.brackenhouse.net/weather/wxclimate.php (http://www.brackenhouse.net/weather/wxclimate.php). Something similar to that would be great, if not, I'll have to do all the coding myself.
Title: Re: Adding stats to website
Post by: elagache on July 28, 2015, 11:05:49 PM
Dear Alan, Jos, Steve, and WeatherCat fans,

I think I'm looking for something that doesn't exist Randy.

I think you are correct.  WeatherCat can now create NOAA styled reports, but they are created as Acrobat PDF files.  You could easily upload them with a little bit of scripting, but that might not be what you are looking for.

You might consider asking for Stu to support something like this as a feature request, but I'm not sure that will fit the bill either.  It would be hard to create HTML that would look as nice as your old site in some sort of generic way.  I suppose another way to get what you want is to ask one of the web template developers if they could add that feature.  I would expect this will become more sought-after as questions about climate change continue swirl around scientific and political circles . . .

Cheers, Edouard . . .  [cheers1]

P.S. . . .  [wink] . . .  It just dawned on me!  I've discovered the true cause of global warming!

It must be all that hot air coming from all those politicians talking about it!!
. . . . .  [rolleyes2]

 [lol2]
Title: Re: Adding stats to website
Post by: Alan Rowley on July 29, 2015, 06:53:29 AM
What I would really like Edouard, is some way of incorporating the six years of data that I accumulated with Weather Display. Now that would really please me. I can but dream. I would love to see pages like all-time records pick up the data since I started monitoring the weather. This page (http://www.brackenhouse.net/weather/wxnoaarecords.php (http://www.brackenhouse.net/weather/wxnoaarecords.php)) was also a page I viewed regularly. It can tell you the records for any day in your history, and would be a great addition to any template set.

ALAN.
Title: Re: Adding stats to website
Post by: wurzelmac on July 29, 2015, 08:04:12 AM
WeatherCat can now create NOAA styled reports, but they are created as Acrobat PDF files.  You could easily upload them with a little bit of scripting, but that might not be what you are looking for.

Hello Edouard & Alan,
there are web tags available for NOAA this month/last month and NOAA this year/last year. For all other NOAA reports you are right, Edouard, only available as PDF.
(Look at WeatherCat Tags Reference (http://live.trixology.com/custom/))

Cheers,
Reinhard
Title: Re: Adding stats to website
Post by: Alan Rowley on July 29, 2015, 10:18:27 AM
Thanks Wurzel, adding a stats page is now high on my list of jobs to do, now that I know what to do.

ALAN.
Title: Re: Adding stats to website
Post by: Blicj11 on July 29, 2015, 04:03:38 PM
Alan:

When you build your stats page, you can copy the NOAA pdf for any previous year and past it on your statistics page. Since this is a one-time copy and paste, it is not too burdensome to get previous years' data onto a page. It's how I built mine. Of course, this assumes you have the data in the database, but I am talking about going forward with your WeatherCat data.
Title: Re: Adding stats to website
Post by: Alan Rowley on July 29, 2015, 04:21:16 PM
I have data going back six years captured by Weather Display. It produced files which I can use on my new site, once I have designed a page. I twon't be too much of a burden.
Title: Re: Adding stats to website
Post by: Alan Rowley on August 03, 2015, 06:16:49 PM
I'm using WDTEXT$ to produce the current wind direction in text, but I want to produce the similar for 24HRSAGO, LASTWEEK, LASTMONTH etc, but nothing seems to work. Anyone any ideas? What am I missing?
Title: Re: Adding stats to website
Post by: xairbusdriver on August 04, 2015, 01:19:21 AM
I'm assuming you've checked the <WC tags (http://live.trixology.com/custom/)> list and something following the example: STAT$ITEM:TYPE:PERIOD$ doesn't work? As in: ( the "|" means "or" [computer])
Quote
STAT$WINDSPEED|AVERAGEWINDSPEED|WINDGUST:(line-break)
24HRSGO|MIN|MAX|AVERAGE:(line-break)
YESTERDAY$|THISWEEK$|LASTWEEK$|THISMONTH$|(line-break)
LASTMONTH$|THISYEAR$|LASTYEAR$|THISSEASON$|ALLTIME$
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 06:34:32 AM
I'm using the following to create the current wind direction
Quote
STAT$WINDDIRECTION:CURRENT$? (WDTEXT$)

This gives me
Quote
206? (SW)

To get the direction at the same time yesterday, I'm using
Quote
STAT$WINDDIRECTION:24HRSAGO$? (WDTEXT$)

The wind direction is correct in degrees, but in text, I get the wind direction now, not yesterday. Obviously I need to add something to the (WDTEXT$) tag, but nothing seems to work.

This is the offending page - http://www.brackenhouse.net/weather27/index.php?p=35&lang=en (http://www.brackenhouse.net/weather27/index.php?p=35&lang=en)

ALAN.
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 11:16:24 AM
Thanks guys for pointing me in the right direction. I've now got dozens of stats on my site - in fact, it's looking stat-tastic.

Click on my site and look under 'WeatherCat Stats'. If you spot anything that doesn't look right, please let me know.
Title: Re: Adding stats to website
Post by: xairbusdriver on August 04, 2015, 01:50:24 PM
Ahhh. WDTEXT$ is defined as "current", so you'd need to find a different tag. Not sure there is one...
If you find it, you be able to combine two STAT$ 'commands'. You already have the correct (I assume) degree. So adding "STAT$WINDDIRECTION:SomeTimeFrame:TheHistoricalDirectionTag" should work. I gotta eat some breakfast! ;)
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 02:00:51 PM
The current wind direction is correct, it's the 24 hours ago direction that generates a syntax error.
Title: Re: Adding stats to website
Post by: xairbusdriver on August 04, 2015, 03:18:17 PM
Uhmmm... I don't see any "syntax error" on the linked page. I assume(!) you mean one of the outputs is incorrect. Just to be clear, which "direction" is incorrect? The 'degrees' or the 'cardinal, textual' output (W, N, ENE, etc.)?

BTW, your site is looking great! [tup]
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 03:28:58 PM
At the moment, the 'yesterday' direction is correct, because the wind is blowing from the same direction as it was 24 hours ago, but the tag is actually the CURRENT wind direction not the 24HRSAGO tag. The 'yesterday' direction will always show the current direction.

I need something like (WDTEXT:24HRSAGO$) but I can't work out the correct format.
Title: Re: Adding stats to website
Post by: xairbusdriver on August 04, 2015, 03:53:25 PM
I agree, there doesn't seem to be a "windTEXT$" tag for anything other than "current". Probably because it isn't stored in the database.

It shouldn't be terribly hard to write a script that would convert the degree value into as many 'cardinal' directions as you want. You can insert a php script right in the middle of a line html. I think there are generally only 16 choices. Mainly a math problem and/or a bunch of case (15) statements. ;)
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 03:56:32 PM
I'm not an expert in php. Maybe some nice coder could help me out. Hint, hint ...
Title: Re: Adding stats to website
Post by: wvdkuil on August 04, 2015, 04:23:08 PM
I'm not an expert in php. Maybe some nice coder could help me out. Hint, hint ...
Most functions are in wsFunctions.php
So try this after you put the field-name of the winddirection where it now reads $degrees.
Code: [Select]
<?php echo  wsConvertWinddir ($degrees); ?>
Title: Re: Adding stats to website
Post by: xairbusdriver on August 04, 2015, 04:27:50 PM
wvdkuil = Not only "nice" but fast! [tup]
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 04:53:34 PM
Fast, but much too fast for me. I did say I wasn't good with php. This is what I have for that line ...

Quote
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir ($degrees); ?></td>

The output I get is ...

Quote
252?
Notice: Undefined variable: degrees in /home/alanrowley3/public_html/weather27/uploadWC/wcs_recent.php on line 258
---

The 252?  is correct, but it seems that I need to declare the variable 'degrees' somewhere.

Help - ALAN
Title: Re: Adding stats to website
Post by: wvdkuil on August 04, 2015, 05:12:38 PM
Fast, but much too fast for me. I did say I wasn't good with php. This is what I have for that line ...

Quote
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir ($degrees); ?></td>

The output I get is ...

Quote
252?
Notice: Undefined variable: degrees in /home/alanrowley3/public_html/weather27/uploadWC/wcs_recent.php on line 258
---

The 252?  is correct, but it seems that I need to declare the variable 'degrees' somewhere.

Help - ALAN

Code: [Select]
<td>STAT$WINDDIRECTION:24HRSAGO$&deg; <?php echo  wsConvertWinddir (STAT$WINDDIRECTION:24HRSAGO$); ?></td>If you want both degrees and cardinal in the same <td> and if the file is processed by WC and uploaded.
The uploaded file would look like:
 
Code: [Select]
<td>180&deg; <?php echo  wsConvertWinddir (180); ?></td>Wim
Title: Re: Adding stats to website
Post by: Alan Rowley on August 04, 2015, 05:35:10 PM
Works a treat, Wim. I've added the code to the 'average wind direction' table on the same page and it's looking great.

Thanks yet again.

ALAN.