Author Topic: Saratoga scripts and Weather-Display  (Read 1018 times)

0 Members and 1 Guest are viewing this topic.

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Saratoga scripts and Weather-Display
« on: April 01, 2018, 10:44:20 PM »
I'm at the very beginning stage of setting up a new website http://bensweather.com/live/Base-USA/wxindex.php

How to I make the weather data update more in real-time, every few seconds as opposed to every 5 minutes, and I'd like to shut off the 'updates in counter' and just have the data auto update every few seconds. I don't see a setting anywhere for that...? I'm using a DaviS VP+II with Weather-Display.

Like on the Saratoga page, it just updates... https://saratoga-weather.org/index.php

Thanks for any insight!

Ben
« Last Edit: April 02, 2018, 12:26:11 AM by bbrissey »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6873
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga scripts and Weather-Display
« Reply #1 on: April 01, 2018, 11:37:17 PM »
In your Settings-weather.php, you have:
Code: [Select]
$SITE['WXtags']            = '/home/bensweather/public_html/testtags.php';  // for weather variables .. we're using the old name instead of WDtags.php
$SITE['ajaxScript']     = 'ajaxWDwx.js'; // for AJAX enabled display
$SITE['clientrawfile']  = '/home/bensweather/public_html/clientraw.txt';  // directory and name of Weather-Display realtime.txt file

That indicates that your Weather-Display is set to upload files into your document root, while your Saratoga website is in the live/Base-USA/ directory under your document root.

I'd suggest changing Settings-weather.php to have
Code: [Select]
$SITE['WXtags']            = '../../testtags.php';  // for weather variables .. we're using the old name instead of WDtags.php
$SITE['ajaxScript']     = 'ajaxWDwx.js'; // for AJAX enabled display
$SITE['clientrawfile']  = '../../clientraw.txt';  // directory and name of Weather-Display realtime.txt file

$SITE['HistoryFilesDir']  = '../../';    // directory location for the [month][year].htm history files
$SITE['HistoryGraphsDir'] = '../../';    // directory location for the YYYYMMDD.gif graphic daily report files
and change ajaxWDwx.js from
Code: [Select]
var clientrawFile = 'clientraw.txt'; // location of clientraw.txt relative to this page on website to
Code: [Select]
var clientrawFile = '/clientraw.txt'; // location of clientraw.txt relative to this page on website
or
Code: [Select]
var clientrawFile = '../../clientraw.txt'; // location of clientraw.txt relative to this page on website
to match the real location of clientraw.txt on your website.

The difficulties are due to installation in a subdirectory, rather than the customary installation in the document root.  Also, it is better to always use relative directory addressing -- you may change hosts in the future, and then the absolute file paths to your document root would likely change.

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

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #2 on: April 02, 2018, 12:27:27 AM »
Thanks, yeah I have to do some testing before I make it live, I s'pose I could still put it in the root directory and just use the wxindex for now. Thanks for the insight! Will play with it tomorrow.

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #3 on: April 02, 2018, 12:36:18 AM »
Thanks, yeah I have to do some testing before I make it live, I s'pose I could still put it in the root directory and just use the wxindex for now. Thanks for the insight! Will play with it tomorrow.

Yes, that worked like a charm! Much to play with in there.

I'm digging around, what's the easiest way to kill the 'Updated @' and 'Countdown to next update' etc.

http://bensweather.com/live/Base-USA/wxindex.php
« Last Edit: April 02, 2018, 12:41:33 AM by bbrissey »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6873
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga scripts and Weather-Display
« Reply #4 on: April 02, 2018, 11:35:10 AM »
Hi Ben,

That display is done in ajax-dashboard.php with
Code: [Select]
        <tr align="center">
          <td class="data1" colspan="4" style="text-align: center">
    <span class="ajax" id="ajaxindicator"><?php langtrans('Updated'); ?>:</span>&nbsp;@
    <span class="ajax" id="ajaxdate">
    <?php echo fixup_date($date) . ' ' fixup_time($time);
  if(isset($timeofnextupdate)) { echo " - " langtransstr('next update at') . " " fixup_time($timeofnextupdate);} ?>

    </span>&nbsp;<span class="ajax" id="ajaxtime"></span>
            <?php if(isset($SITE['ajaxScript'])) { ?>
            <script type="text/javascript">
<!--
document.write('<b> - <?php langtrans('updated'); ?> <span id="ajaxcounter"></span>&nbsp;<?php langtrans('sec ago'); ?></b>');
//-->
            </script>
            <?php // there is a ajaxScript ?>
          </td>
        </tr>
then just remove that code.   If you want just the countdown timer to disappear change
Code: [Select]
            <?php if(isset($SITE['ajaxScript'])) { ?>
to
Code: [Select]
            <?php if(false and isset($SITE['ajaxScript'])) { ?>
Hope this helps...

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

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #5 on: April 02, 2018, 11:54:26 AM »
Hi Ben,

That display is done in ajax-dashboard.php with
Code: [Select]
        <tr align="center">
          <td class="data1" colspan="4" style="text-align: center">
    <span class="ajax" id="ajaxindicator"><?php langtrans('Updated'); ?>:</span>&nbsp;@
    <span class="ajax" id="ajaxdate">
    <?php echo fixup_date($date) . ' ' fixup_time($time);
  if(isset($timeofnextupdate)) { echo " - " langtransstr('next update at') . " " fixup_time($timeofnextupdate);} ?>

    </span>&nbsp;<span class="ajax" id="ajaxtime"></span>
            <?php if(isset($SITE['ajaxScript'])) { ?>
            <script type="text/javascript">
<!--
document.write('<b> - <?php langtrans('updated'); ?> <span id="ajaxcounter"></span>&nbsp;<?php langtrans('sec ago'); ?></b>');
//-->
            </script>
            <?php // there is a ajaxScript ?>
          </td>
        </tr>
then just remove that code.   If you want just the countdown timer to disappear change
Code: [Select]
            <?php if(isset($SITE['ajaxScript'])) { ?>
to
Code: [Select]
            <?php if(false and isset($SITE['ajaxScript'])) { ?>
Hope this helps...



It will, you're a genious, thanks!

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3314
    • Carson Valley Weather
Re: Saratoga scripts and Weather-Display
« Reply #6 on: April 02, 2018, 10:44:30 PM »
Ben,

Your WXFORUM profile website address points to "https://www.wxforum.net/bensweather.com". That is obviously incorrect.

Best of luck getting your website setup the way you want it.
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37s80,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #7 on: April 02, 2018, 10:48:25 PM »
Ben,

Your WXFORUM profile website address points to "https://www.wxforum.net/bensweather.com". That is obviously incorrect.

Best of luck getting your website setup the way you want it.

Thanks! I've not setup my profile so I dunno where that came from, haven't logged in here in like 5 years, but I'll clean it all up. I did check my profile and it just says benseather.com, so the forum must be adding it....

Thanks again all!

-Benny
« Last Edit: April 02, 2018, 11:03:03 PM by bbrissey »

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #8 on: April 03, 2018, 01:06:20 AM »
Oh hey, one more question, for now.

I noticed the mapping for earthquakes fails on loading, it loads for a couple seconds, then comes up with a java error, any ideas?

http://bensweather.com/live/Base-USA/quake-json.php

Thanks again, and again!

Offline zmarfak

  • Member
  • *
  • Posts: 41
    • Matar
Re: Saratoga scripts and Weather-Display
« Reply #9 on: April 03, 2018, 09:51:01 AM »
Oh hey, one more question, for now.

I noticed the mapping for earthquakes fails on loading, it loads for a couple seconds, then comes up with a java error, any ideas?

http://bensweather.com/live/Base-USA/quake-json.php

Thanks again, and again!

I think your Google API key is not ok of not setup ?
from the console of my browser :

Logging system initialised at Tue Apr 03 2018 15:48:13 GMT+0200 (Romance Summer Time)
common.js:206:17
Google Maps API error: InvalidKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error
js:41:430
Google Maps API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key
--
Patrick

Davis Vantage Pro2 with a WLIP logger, Intel NUC with WL6.0.4 https://www.matar.be

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #10 on: April 03, 2018, 02:32:59 PM »
Yah thanks, I did put in the API key I got from google but the problem persists...

I would think I would be getting an API error if it was with the key, I'm getting "
Oops! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details."

I put the key in quake-json.php, is it also somewhere else?
« Last Edit: April 03, 2018, 02:52:24 PM by bbrissey »

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #11 on: April 03, 2018, 02:57:38 PM »
Disregard, I got it, just need to learn to read more, lol. Put that line in the settings.php and it fixed it up....

Offline bbrissey

  • Member
  • *
  • Posts: 14
    • Bensweather
Re: Saratoga scripts and Weather-Display
« Reply #12 on: May 12, 2018, 10:51:43 PM »
Hey guys, I got an udder question for ya. I'd like the live weather to continuously update every 5 seconds or so, how do I shut off that auto-pause feature? If I don't refresh the page after about a minute, it pauses weather data, that's annoying.


Thanks again!

 

anything