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

0 Members and 1 Guest are viewing this topic.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • 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
###########################################################################
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline hymrog

  • Senior Member
  • **
  • Posts: 52
    • Gahanna Weather
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: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Help with WU History PHP
« Reply #2 on: January 30, 2018, 04:34:12 PM »
Sorry, no go.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline hymrog

  • Senior Member
  • **
  • Posts: 52
    • Gahanna Weather
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: 5509
    • KomokaWeather
Re: Help with WU History PHP
« Reply #4 on: January 30, 2018, 09:34:34 PM »

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • 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 »

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • 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.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • 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

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • 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.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

 

anything