Poll

Would you like an AJAX/PHP template for your weather software?

Yes, for WeatherLink
23 (28%)
Yes, for VWS
32 (39%)
Yes, for Cumulus
21 (25.6%)
Yes, for WU_HU
5 (6.1%)
Yes, for WXSolution
1 (1.2%)

Total Members Voted: 62

Voting closed: February 05, 2011, 10:24:55 PM

Author Topic: Are you interested in a AJAX/PHP template set for WL, VWS, Cumulus, ...etc?  (Read 18667 times)

0 Members and 1 Guest are viewing this topic.

Offline pablo

  • Member
  • *
  • Posts: 32
Hi everyone,

@Ken, this may save you some time with getting support for `wview'

I've started a Sourceforge project to build a bridge between `wview' and the Saratoga pages.  Specifically, I'm feeding the `Saratoga' pages the WD `clientraw.txt' file along with `testtags.php'   I believe I have all the data to feed `trends-inc.html' as well but I haven't had a chance to test it.  And a long time ago, I turned off that page on my site.  :]

If you're interested in seeing my `Saratoga' pages (still in beta!), being fed with my `bridge', see http://weather.hillsandlakes.com

I'm still writing code so if you go to it and it's busted, it's because I've broken it again.  :)

The `wview' pages for the same data can be found here -- http://wview.hillsandlakes.com

Both web sites run on my klunky 512MB RAM/600 MHz laptop (server!)

btw, if anyone is interested in joining the `wview2saratoga' user/dev e-mail lists, I can post the details.

Cheers,
-pablo

Offline C5250

  • Forecaster
  • *****
  • Posts: 840
    • Local weather
Kinda funny you would bring this up, a few years ago now, I did pretty much the same thing as Tom (CarterLake) for WxSolution. Just a couple weeks ago I was thinking about trying to align my efforts with the WD testtags output. But it looked like that's only in C? To me that would suggest there is a double conversion for a site that uses F, so that along with I wasn't thrilled about having to rewrite every page of my site kinda chilled that idea.

In any case, if you need some help with a WxSolution shim, I can help out.
Precious little in your life is yours by right and won without a fight.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
But it looked like that's only in C?

The units in the testags file is what the user have chosen, so it could be either C or F.
Lars Magnusson
Axelvold / Sweden
55° 57' 41" N / 13° 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
It is a wild ride seeing what each weather software offers for substitution tags and some form of realtime updates.  Most of the weather software packages do allow the station owner to pick the basic units used for their station from a mix of commonly used units-of-measure.   Here's what my research (so far) has shown:

Weather-Display - selectable units for tags, realtime info (clientraw.txt) always in C,kts,hPa,mm  (for temp, wind, baro, rain) - has HTML tags for selected units %uom...%
VWS - selectable units for tags, realtime info (WeatherFlash updates) always in F,mph,inHg,in - has HTML tags for selected units ^uni...^
WeatherLink - selectable units for tags, no built-in realtime (WU Rapid-fire doesn't count per-se). has HTML tags for selected units <!--units....->
Cumulus - selectable units for tags (with multiple units available for each tag), realtime (realtime.txt) has selectable units, with embedded UOM used, has tags for selected units <#....unit>
WXSolution - selectable units for tags, no realtime (AFAIK), has tags for selected units $U.$

I haven't looked at WView or WUHU fully yet but thanks to Pablo and C5250, I'll have a head start on those shims.

The basic template will currently present the information in whatever units your station is setup to report.  The corresponding AJAX script will just update the page based on whatever available values from the realtime-file.

The plan is still to make the VWS version first (and I'm about 80% finished with it), then do the WeatherLink version (which requires the most 'helper scripts' since it has the fewest provided tags), then on to the others.. looks like Cumulus would be third at this time.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 5509
    • KomokaWeather
Quote
looks like Cumulus would be third at this time

yaa, but neck-and-neck 8-)

Thanks Ken for your work on this,

Paul

Offline nitrx

  • Senior Contributor
  • ****
  • Posts: 277
    • Apeldoorn-Oost The Netherlands
Looking forward to the Cumulus template just too late for voting  ](*,)
Ron
Cumulus software
Apeldoorn NL
http://www.apeldoornmeteo.nl

several languages

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Voting was a bit fun... I've reopened the poll for another two weeks :)

Developer's log:

"Fractal Development" seems to be the way this is working.  As I examine what the major packages provide in tags v.s. what's needed to populate the dashboard and other pages, I've had to dig-in and create:
1) a moon ephemeris (for phase dates)
2) a seasonal ephemeris (for astronomy page)
3) a moon current information (based on the USNO) for phase, illumination, rise/set for sun/moon based on lat/long
4) a new flyout-menu that allows some items to be presented if the supporting weather software is installed
   (so that a mesonet link won't appear unless VWS is being used),
and lastly the biggie..
5) a METAR parser to yield the 'current WD iconnumber' and 'weather/sky description' based on your nearby METAR specified.

Now on to the finishing touches with VWS pages, then WeatherLink, then Cumulus and it will be out for testing :)
Oh, yeah... something about docs pages... hmmmm.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline George Richardson

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 1391
    • Smith Mountain Lake Weather
"Voting was a bit fun... I've reopened the poll for another two weeks"

Then, do we all get to vote again?  \:D/

George

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
I just finished watching The Social Network. Ken, someday there will be a movie about you. lol
 :-P
Tony




Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
"Voting was a bit fun... I've reopened the poll for another two weeks"

Then, do we all get to vote again?  \:D/

George
You can change your vote(s), but you still only get one vote set per forum userid :)

I just finished watching The Social Network. Ken, someday there will be a movie about you. lol
 :-P

Oh, I dearly hope there's no movie about me!  The last 'movie' I was in was my training class I taught at work about the architecture and features of the internet firewall structure we had designed/built.  I was a PowerPoint ninja back-in-the-day :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
More progress to report:

The VWS plugin set is complete (with AJAX)
The WeatherLink PHP is complete .. need to test the AJAX (thanks to Curly for the initial AJAX script)
The Cumulus PHP is complete .. need to finish the AJAX (Based on Beteljuice's script)

By going through all three packages, I've been able to make the ajax-dashboard dynamically adjust to display what it has available in tags from the various software.  WeatherLink is the most sparse (fewest available tags).  Cumulus has more tags, but not a lot of historical info.  VWS has a plethora of tags, but not all are really useful for display.

Where key tags are missing, but can be derived by using other tags, I've added that to the -defs.php file for that software.
Examples:
VWS has these computed values:
$tempnodp  = round($WX['vxv007'],0); // calculated value
$dayswithnorain  = intval((time()-strtotime($WX['vyd009']))/86400); // from yrly rain high date // calculated value
$yesterdayrain  = sprintf('%01.2f', round($WX['vzh009']-$WX['vzl009'],2)); // calculated value
$mrecordhighgustday  = date('j',strtotime($WX['vmd003'])); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------

$Currentsolardescription = $WX['climate_cconds1'];  // Current Conditions
$iconnumber = VWS_icons($WX['climate_icon1'],$WX['vst143'],$WX['vst144'],$WX['vst145']);
if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
   global $SITE;
   include_once("get-metar-conditions-inc.php");
   list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
  = VWS_setDateTimes($WX['vst142'],$WX['vst143'],$SITE['WDdateMDY']);

Likewise, WeatherLink has

$tempnodp  = round($WX['outsideTemp'],0); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------

if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
   global $SITE;
   include_once("get-metar-conditions-inc.php");
   list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
  = WL_setDateTimes($date,$time,$SITE['WDdateMDY']);

$beaufortnum =  WL_beaufortNumber($WX['windSpeed'],$WX['unitWind']);
$bftspeedtext = WL_beaufortText($beaufortnum);

if(!isset($wdversion) and isset($SITE['WXsoftwareVersion'])) {$wdversion = $SITE['WXsoftwareVersion']; }

list($feelslike,$heatcolourword) = WL_setFeelslike ($temperature,$windch,$heati,$uomtemp);

and Cumulus has:

$time  = substr($WX['time'],0,5); // calculated value
$wdversion  = $WX['version'].'-b'.$WX['build']; // calculated value
$timeofnextupdate  = date('H:i',strtotime($date.' '.$time)+intval($WX['interval']*60)); // calculated value
$tempnodp  = round($WX['temp'],0); // calculated value
#-------------------------------------------------------------------------------------
# function processed WD variables
#-------------------------------------------------------------------------------------

if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
   global $SITE;
   include_once("get-metar-conditions-inc.php");
   list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
  = CU_setDateTimes($date,$time,$SITE['WDdateMDY']);

$beaufortnum =  CU_beaufortNumber($avgspd,$winduom);
$bftspeedtext = CU_beaufortText($beaufortnum);

if(!isset($wdversion) and isset($SITE['WXsoftwareVersion'])) {$wdversion = $SITE['WXsoftwareVersion']; }

list($feelslike,$heatcolourword) = CU_setFeelslike ($temperature,$windch,$heati,$uomtemp);

if(substr($WX['LastRainTipISO'],0,4) <> '0000') { // got a last rain valid date
 $dateoflastrainalways = $WX['LastRainTipISO'];
 $dayswithnorain = intval((time()-strtotime(substr($dateoflastrainalways,0,10)))/86400);
}

Just thought you'd like to see some of the behind-the-scenes progress :)

I've you've not already voted, please do so .. it does help to guage your interest in specific station plugins.

Best regards,
Ken

Currently on the test site is the Cumulus set.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Oh my, it looks like we are getting very close to a beta release - YIPPEE!!!  \:D/

I've given up trying to develop my own template - just too busy in my retirement...

If you need a tester, I'm here...
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Yes, getting closer.  I'm working on the Cumulus AJAX and WeatherLink AJAX scripts now. I'll keep you in mind for a tester Don .. thanks for the offer.

I've added a testing feature to the test site that allows you to pick which weather software to drive the site dynamically (so you can see what's there/not there based on what the weather software provides.

Weather-Display:  http://saratoga-weather.org/wxtemplates/Test/wxindex.php?wx=WD
VWS:                  http://saratoga-weather.org/wxtemplates/Test/wxindex.php?wx=VWS
Cumulus:             http://saratoga-weather.org/wxtemplates/Test/wxindex.php?wx=CU
WeatherLink:       http://saratoga-weather.org/wxtemplates/Test/wxindex.php?wx=WL

You can add the ?wx= argument to any page .. I suggest you try the Station Reports page in the almanac
to see how the various software report the trends graphs.

Now... back to coding

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Thanks Ken - this is something those of us who have been VWS die-hards have wanted for a long time. Your endless talents and efforts are really appreciated.  =D&gt;

Now, don't bother answering this - just keep coding...  :grin:

Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Ken,
Sorry if you already addressed this.  I have my old site powered behind the scenes by your original VWS ajax (still running), and my current site powered by WD and your templates... will the two peacefully co-exist in the root, or will I have to do something funky with subdirectories and paths?

Thanks
Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Andrew,

If you notice, Ken has a /test sub-directory that he is running his sample template in. I'm hoping that is the case as that is what I was planning to do when testing his scripts before placing live on my website. I'm also using his old AJAX code for my existing site.
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Andrew/Don,
While the template sets are usually intended to run in the document root of the website, you can run them in a subdirectory if the templates are unpacked and preserve the relative directory structure.  You may have to fiddle with some Settings.php items and some page internal setups to change settings to point to where the weather data is really loaded on the site.

A bit complicated, but doable.  I've used symlinks in the /wxtemplates/Test directory to point to where I really have stuff loaded.  For example, I upload the WD weather data to / (document root), VWS to /AJAX/VWS, Cumulus to /cumulus
so I used the following symlinks in the /wxtemplates/Test directory:

VWS:
ln -s ../../AJAX/VWS/VWStags.php VWStags.php
(and similar links for each image file for the graphs)

WD:
ln -s ../../testtags.php testtags.php
ln -s ../../clientraw.txt clientraw.txt

Cumulus:
ln -s ../../cumulus/realtime.txt realtime.txt
ln -s ../../cumulus/CUtags.php CUtags.php
ln -s ../../cumulus/images images

WeatherLink
ln -s ../../WLtags.php WLtags.php
ln -s ../../WLrealtime.txt WLrealtime.txt

So, with that bit of slight-of-hand, the one directory /wxtemplates/Test thinks all the important files are in it's directory.

Progress:
Finally fixed all the issues with the ajaxCUwx.js Cumulus AJAX script.  Grrrr... JavaScript gives me the hives.. any language that just quietly stops running at the first error makes it really hard to debug (even with FireBug in Firefox).

Now, on to the ajaxWLwx.js AJAX for WeatherLink. then back to the basic scripts to add a global PHP cache directory option so you can put all the included scripts cache files in a subdirectory that you make writable.

I hope to release the Release Candidate templates this weekend for hearty souls to try out while I work on the documentation :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Thanks for the explanation Ken.

One more quick question. I am running VWS v14.00 p101. Should I update to the latest version before attempting to do any testing with your new scripts? Just want to be ready when give us the "word"...  ;)
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
No need to upgrade.. my testing is with V14.01p33 and the template works fine .. I was even running it with V14.00p?? fine too.

Afternoon progress report:

Finished both the Cumulus and WeatherLink AJAX scripts.  Now going through the base Canada, USA, World template sets to make sure all works without having a weather station selected (that all the support scripts work).

I've finished modifying the support scripts to allow a cache directory to be used (instead of the same directory the template is in) .. this will cut down on the clutter, and let you mark just one directory as writable by PHP for the cache files for all the included scripts in each base geography template.

Now on to packaging, and doing an alpha test of the package combinations  geography:weather software
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Ok.. time to start the beta engine..  Please use this thread posting for beta downloads and instructions (such as they are).  Reply with any issues to that thread.

Thanks and best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline dgunnell

  • Member
  • *
  • Posts: 1
Any further progress on a wview plugin?

Thanks,

Dave

Offline wbond

  • Member
  • *
  • Posts: 16
    • Chelsea Cove Weather
Hi Ken,

I really like the look of the scripts you have written, very nice work.  I'm working on installing them and have a pretty basic question.  I'm runnign VWS, but have not used WF before.  I installed the wflash files in the root directory of my site and when I try to run the wflash-filetest.php script I get the following error message:

Test for WeatherFlash file writing by PHP
PHP Version 4.4.9
Parsing site.txt configuration
Warning: site.txt file missing or empty.
Unable to continue test.

The site.txt file is clearly there when I look in the /wflash directory and even if I change the wflash-filetest.php script to point to the full path I get the same result.  I'm guessing it's something obvious that I've overlooked, but I haven't figured it out yet.  I know you said in the email below that the scripts would not require the WF product itself, but did that change?  Any suggestions would be apprecaited.

thank you,
Bill




For an option more than once, nope.. for several options, once each, yes :)

Yes, the VWS version would use the WeatherFlash uploads from VWS as the source for the AJAX updates (but it doesn't mean you have to buy the WF product itself.. just use the VWS uploads).  This is the same as with Weather-Display and the clientraw.txt uploads used by the AJAX script and by the optional WDLive application.

It's a bit more tricky with WeatherLink which doesn't have a 'realtime' feature except for the Wunderground RapidFire module (which we can't really use).  So that AJAX update will be limited to once-per-minute which is the smallest interval for which WeatherLink FTP can be scheduled.

Best regards,
Ken

Davis VP2+
Weatherlink Serial
VWS v14.00p86
DW3025

Offline jay_hoehn

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 656
    • Jay's Woodcrafts
Bill,

As stated in the info on the scripts page you need to be running PHP 5.  I'm not sure if that is the problem, but could be.

Jay
Davis Vantage Pro2 Plus
VVP
Weather Display


Offline wbond

  • Member
  • *
  • Posts: 16
    • Chelsea Cove Weather
Bill,

As stated in the info on the scripts page you need to be running PHP 5.  I'm not sure if that is the problem, but could be.

Jay

Thanks for the reply Jay.  I'm using Godaddy for hosting so I thought it would work, but now I'm thinking that you are correct and have initiated the upgrade to php5 on Godaddy, which can take up to 24 hours.

Bill

Davis VP2+
Weatherlink Serial
VWS v14.00p86
DW3025

 

anything