Author Topic: Help with WU History PHP  (Read 2160 times)

0 Members and 1 Guest are viewing this topic.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 702
  • BismarckWeather.net
    • BismarckWeather.net
Help with WU History PHP
« on: January 30, 2018, 01:17:40 PM »
Is the Weather Underground History script working?  Thought I would give it a try to implement it.  Not working for me.

http://www.bismarckweather.net/wxwuhistory.php

Added this to my Settings.php file.
Code: [Select]
###########################################################################
# WU-History settings
$SITE['WUID'] = 'KNDBISMA26'; // set to Wunderground ID (upper case)
//$SITE['WUunits'] = 'E'; // units to display 'E'=english, 'M'=metric, 'B'=both
//             comment $SITE['WUunits'] above out to use uomTemp to select English or Metric
$SITE['WUstationname'] = 'Bismarck, North Dakota, USA'; // for legend at bottom of page
$SITE['WUbirthday'] = '03-12-2016'; //Stations first day of operation format dd-mm-yyyy
###########################################################################
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline hymrog

  • Member
  • *
  • Posts: 30
    • NewAlbanyWeather
Re: Help with WU History PHP
« Reply #1 on: January 30, 2018, 04:30:40 PM »
Hello -

Change this:
Code: [Select]
$SITE['WUbirthday'] = '03-12-2016'; //Stations first day of operation format dd-mm-yyyy 

to:

Code: [Select]
$SITE['WUbirthday'] = '12-03-2016'; //Stations first day of operation format dd-mm-yyyy
g

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 702
  • BismarckWeather.net
    • BismarckWeather.net
Re: Help with WU History PHP
« Reply #2 on: January 30, 2018, 04:34:12 PM »
Sorry, no go.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline hymrog

  • Member
  • *
  • Posts: 30
    • NewAlbanyWeather
Re: Help with WU History PHP
« Reply #3 on: January 30, 2018, 08:27:37 PM »
Hmmm...it has been awhile since I had this script on my site but I made the same mistake with the start date for WU and once I corrected I was good to go. I will take a look and see if I still have the script.

g

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4170
    • KomokaWeather
Re: Help with WU History PHP
« Reply #4 on: January 30, 2018, 09:34:34 PM »
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/   www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1287
    • My PWS at Leuven Belgium Europe
Re: Help with WU History PHP
« Reply #5 on: January 31, 2018, 03:03:38 AM »
Is the Weather Underground History script working?  Thought I would give it a try to implement it.  Not working for me.

http://www.bismarckweather.net/wxwuhistory.php

Added this to my Settings.php file.
Code: [Select]
###########################################################################
# WU-History settings
$SITE['WUID'] = 'KNDBISMA26'; // set to Wunderground ID (upper case)
//$SITE['WUunits'] = 'E'; // units to display 'E'=english, 'M'=metric, 'B'=both
//             comment $SITE['WUunits'] above out to use uomTemp to select English or Metric
$SITE['WUstationname'] = 'Bismarck, North Dakota, USA'; // for legend at bottom of page
$SITE['WUbirthday'] = '03-12-2016'; //Stations first day of operation format dd-mm-yyyy
###########################################################################
When running http://www.bismarckweather.net/wxwuhistory.php the rest of the page remains empty => no footers a.s.o.
The reason is either a parser error or a 500 error.

As error reporting is suppressed the errors are not displayed and we are left in the dark (or better white) what is happening.
Please find in wxwuhistory.php the lines with
Code: [Select]
include("menubar.php");
############################################################################

and change to
Code: [Select]
include("menubar.php");
        ini_set('display_errors', 'On');
error_reporting(E_ALL);
############################################################################
This will probably display the errors.

When checking the generated html the last thing displayed is "<div id="main-copy">", the errors seem to occur in the included script
Code: [Select]
<div id="main-copy">

<?php include_once("WU-History-inc.php"); ?>
I compared your version of WU-History-inc.php
http://www.bismarckweather.net/WU-History-inc.php?sce=view
with the one from @PaulMy
http://www.komokaweather.com/komokaweather-ca/WU-History-inc.php?sce=view
and
1. they are very different, yours is from 2008, his from 2016
2. yours has no ssl support which is needed for accesing WU nowadays.

You are also running PHP Version: 7.0.26 according to http://www.bismarckweather.net/check-fetch-times.php
@paulMy is using 5.6
And 7.0.26 does not work well with the socket connect-script to load from WU.

Better upgrade the scripts first. 
I attach a version which should work, I think so. 
It is a copy of @PaulMy version but using CURL instead of  fsockopen in the getcsvWithoutHanging function at the bottom of the script.

Wim
« Last Edit: January 31, 2018, 09:39:04 AM by wvdkuil »
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 702
  • BismarckWeather.net
    • BismarckWeather.net
Re: Help with WU History PHP
« Reply #6 on: January 31, 2018, 12:12:52 PM »
Thanks for the info.  I've downloaded the new INC file, and added the error into the main PHP file.  Still pulling a blank page.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1287
    • My PWS at Leuven Belgium Europe
Re: Help with WU History PHP
« Reply #7 on: January 31, 2018, 12:42:44 PM »
Thanks for the info.  I've downloaded the new INC file, and added the error into the main PHP file.  Still pulling a blank page.
The inc file is still the old one from 2008
Just check: http://www.bismarckweather.net/WU-History-inc.php?sce=view
Did you UNZIP and upload it to your webserver?

Wim
Development and maintenance of Leuven-Template&Scripts  at: https://support.leuven-template.eu/
My PWS at home https://weer.sluispark.be/
And at my daughters house https://www.weerstation-herent.be/

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 702
  • BismarckWeather.net
    • BismarckWeather.net
Re: Help with WU History PHP
« Reply #8 on: January 31, 2018, 12:58:08 PM »
Crap, sorry.  That's what happens when I don't keep better track of test code and production.

Seems to be working now!  Thanks for the help.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

 

anything