Author Topic: Curly's Wx Story script  (Read 6620 times)

0 Members and 1 Guest are viewing this topic.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Curly's Wx Story script
« on: October 31, 2017, 10:07:10 AM »
Within the past few weeks Curly's WxStory script is not working for at least one local office.  For site KIWX Northern Indiana the text is being retreived but the image is not. It still seems to work for the other sites I checked. 

http://ww2.mymishawakaweather.com/wxstory_inc.php

The cache file:

Code: [Select]
<?php

$mainStory 
= array (
  
'Tab2FileL.png?150944' => 
  array (
    
=> 'One More Cold Day',
    
=> 'The cloudy and cold weather will linger for 1 more day with a few showers near Lake Michigan. Warmer temperatures will arrive starting Wednesday, with above normal temperatures by Thursday and Friday. The warmer temperatures will bring increasing chances for showers, especially Thursday and Thursday night.',
    
=> 'http://www.weather.gov/images/iwx/wxstory/Tab2FileL.png?1509444443',
    
=> 'https://www.weather.gov/iwx/weatherstory',
    
=> './wscache/wsimg_iwx_Tab2FileL.png?150944.443',
    
=> '443',
    
=> 'Tab2FileL.png?150944',
    
=> 'iwx',
    
=> 'Northern Indiana',
  ),
);

$altStory = array (
  
'Tab3FileL.png?150944' => 
  array (
    
=> 'Halloween Forecast',
    
=> 'Trick or Treat Forecast: Bundle up as you go out later this afternoon and early evening as temperatures will start in the upper 30s to lower 40s at the start of trick or treating and end up in the middle 30s by the end. Wind should be on the lighter side, but will still make it feel like its 30 to 35 degrees.',
    
=> 'http://www.weather.gov/images/iwx/wxstory/Tab3FileL.png?1509444443',
    
=> 'https://www.weather.gov/iwx/weatherstory',
    
=> './wscache/wsimg_iwx_Tab3FileL.png?150944.443',
    
=> '443',
    
=> 'Tab3FileL.png?150944',
    
=> 'iwx',
    
=> 'Northern Indiana',
  ),
);

$nfo 'Northern Indiana';

$hdlnr = array (
  
=> '     <td style="text-align: center; background-color:#F0F7FF; padding: 6px 0px 6px;"><a href="/wxstory_inc.php?i=iwx&amp;ifn=Tab2FileL.png?150944" title="One More Cold Day" style="text-decoration: none; color: #0071BC; font-size: 1.3em;">One More Cold Day</a></td>',
  
=> '     <td style="text-align: center; background-color:#F0F7FF; padding: 6px 0px 6px;"><a href="/wxstory_inc.php?i=iwx&amp;ifn=Tab3FileL.png?150944" title="Halloween Forecast" style="text-decoration: none; color: #0071BC; font-size: 1.3em;">Halloween Forecast</a></td>',
);


?>

Debugging indicates that the image file is not found (404) yet manually entering the link into a browser displays the image just fine.  I am out of ideas!

Offline East Cobb Weather

  • Signature
  • Contributor
  • ***
  • Posts: 130
    • East Cobb Weather
Re: Curly's Wx Story script
« Reply #1 on: October 31, 2017, 10:24:20 AM »
Wish I can help, but honestly, this is the first time I've seen this script. And I LOVE it! Can anyone provide the raw files? I can't seem to find a valid download link any more.

Eric
Marietta, GA
East Cobb Weather
http://www.eastcobbweather.com


Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #2 on: October 31, 2017, 10:32:09 AM »
Eric799... PM sent!

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #3 on: October 31, 2017, 11:48:13 AM »
For others wishing to have this script it is attached (with Curly's permission).

Offline East Cobb Weather

  • Signature
  • Contributor
  • ***
  • Posts: 130
    • East Cobb Weather
Re: Curly's Wx Story script
« Reply #4 on: October 31, 2017, 12:18:30 PM »
Thanks tmabell!
Eric
Marietta, GA
East Cobb Weather
http://www.eastcobbweather.com


Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 805
    • Southern Maryland Weather
Re: Curly's Wx Story script
« Reply #5 on: October 31, 2017, 12:55:17 PM »
Love the script, but it won't work at Washington-Baltimore NWS office... :(
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #6 on: October 31, 2017, 01:03:36 PM »
I don't think any of the Eastern Region WFO's use the Weather Story.  I might be wrong.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 678
  • BismarckWeather.net
    • BismarckWeather.net
Re: Curly's Wx Story script
« Reply #7 on: October 31, 2017, 01:11:49 PM »
Is the script supposed to pull the graphics as well?

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

If I go to the first link, I don't see any graphics. But then change the office to Bismarck North Dakota, I can see the graphics.

On my own site, I don't see the graphics no matter what.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 678
  • BismarckWeather.net
    • BismarckWeather.net
Re: Curly's Wx Story script
« Reply #8 on: October 31, 2017, 01:17:51 PM »
I looked at the code and realized I needed a wscache folder.  Once I put that there, the images came.

But what is supposed to be in the wsimages folder?  Anything?
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #9 on: October 31, 2017, 01:19:05 PM »
I am able to see the graphics on your site for the default KBIS office, all three (currently) images are there.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #10 on: October 31, 2017, 01:25:08 PM »
I've attached the contents of my wsimages folder.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 678
  • BismarckWeather.net
    • BismarckWeather.net
Re: Curly's Wx Story script
« Reply #11 on: October 31, 2017, 01:28:25 PM »
Thanks!
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #12 on: October 31, 2017, 02:01:25 PM »
I'm not sure but I think those images are used if you enable the map option in the settings of the script.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2013
    • SouthEast Lincoln, NE Weather
Re: Curly's Wx Story script
« Reply #13 on: October 31, 2017, 02:10:30 PM »
If Curly has given his permission to release the WxStory script into the wild, I have his May 20, 2017 final release running on my site.  It works!

The zip is attached.  There is an option to use a 'dropdown' list rather than the map, which is fairly current although some sites shown as red or orange may now have the Weather Story.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #14 on: October 31, 2017, 02:33:51 PM »
He has and thank you Jerry!!

EDIT:

I'm using V2.25 which works with PHP 7.1 but exibits the KIWX bug.  Sadly, V2.23 doesn't work on my site because of unnessary changes made to PHP 7.1 (which is what I'm using)

If you have time to take a look well, your help wolde be greatly appreciated.. as always!
« Last Edit: October 31, 2017, 03:23:47 PM by tmabell »

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2013
    • SouthEast Lincoln, NE Weather
Re: Curly's Wx Story script
« Reply #15 on: October 31, 2017, 06:39:51 PM »
He has and thank you Jerry!!

EDIT:

I'm using V2.25 which works with PHP 7.1 but exibits the KIWX bug.  Sadly, V2.23 doesn't work on my site because of unnessary changes made to PHP 7.1 (which is what I'm using)

If you have time to take a look well, your help wolde be greatly appreciated.. as always!
Not fond here of these perpetual updates which keep breaking scripts!  PHP 7.0 works just fine here.  My original link is running PHP 5.4!  What doesn't work for me under PHP 7.0 is 'whos-online'.  If Ken True can't figure that one out, I'm sure it's beyond me.
« Last Edit: October 31, 2017, 06:43:04 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline mldenison

  • Senior Member
  • **
  • Posts: 64
    • York, PA Weather
Re: Curly's Wx Story script
« Reply #16 on: October 31, 2017, 07:15:59 PM »
I'm not sure what version of php I'm using.  How do I tell?

I just created a page on my Saratoga website and it's working fine: http://www.m82a1.us/wxStory.php - unfortunately no nearby weather stories for me.

I wonder why the eastern NWS stations don't have a weather story.
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #17 on: October 31, 2017, 07:59:18 PM »
The issue is with php 7.1 and up.  I agree which is why I mentioned "unnecessary changes" to PHP 7.  When your version is run on my site with PHP7.1 a fatal error is encounterd:

[php7:warn] [pid 12300:tid 908] [client 192.168.10.156:63217] PHP Warning:  fopen(./wscache/wsimg_iwx_Tab2FileL.png?150947.193): failed to open stream: Resource temporarily unavailable in C:\\www\\wxStory_inc.php on line 356, referer: https://mymishawakaweather.com/wxstory_inc.php?i=lot
[Tue Oct 31 19:56:48.754078 2017] [php7:warn] [pid 12300:tid 908] [client 192.168.10.156:63217] PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in C:\\www\\wxStory_inc.php on line 357, referer: https://mymishawakaweather.com/wxstory_inc.php?i=lot
[Tue Oct 31 19:56:48.754078 2017] [php7:warn] [pid 12300:tid 908] [client 192.168.10.156:63217] PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in C:\\www\\wxStory_inc.php on line 358, referer: https://mymishawakaweather.com/wxstory_inc.php?i=lot
[Tue Oct 31 19:56:48.754078 2017] [php7:error] [pid 12300:tid 908] [client 192.168.10.156:63217] PHP Fatal error:  Uncaught Error: Call to undefined function mb_detect_encoding() in C:\\www\\wxStory_inc.php:371\nStack trace:\n#0 {main}\n  thrown in C:\\www\\wxStory_inc.php on line 371, referer: https://mymishawakaweather.com/wxstory_inc.php?i=lot

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 815
    • North Bend Weather
Re: Curly's Wx Story script
« Reply #18 on: October 31, 2017, 10:49:18 PM »
 The last time i tried this script,  it didn't work for Washington State.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline mldenison

  • Senior Member
  • **
  • Posts: 64
    • York, PA Weather
Re: Curly's Wx Story script
« Reply #19 on: October 31, 2017, 10:59:02 PM »
I just checked on GoDaddy (my host) and I'm running 7.0.  There's some changes enforcing some php scripting that needs to be looked at for 7.1.  Above my paygrade unfortunately.
Windows 7 x64
Weather PC: Intel NUC
Davis Vantage Pro 2
Weather Underground: KPAYORK30
York, PA Weather (Saratoga)
York, PA Weather (Leuven)

Offline Fox_Of_The_Wind

  • Forecaster
  • *****
  • Posts: 390
  • Hi there!
    • http://www.desotowiwx.com
Re: Curly's Wx Story script
« Reply #20 on: December 13, 2017, 09:06:21 PM »
has anyone worked on this script yet? I see mine will not load the image anymore.

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #21 on: December 13, 2017, 10:19:49 PM »
has anyone worked on this script yet? I see mine will not load the image anymore.

Noticed this as well earlier today but haven't had a chance to dig into it yet.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 226
Re: Curly's Wx Story script
« Reply #22 on: December 14, 2017, 09:16:44 AM »
This problem first showed up a few months ago on one or two sites.  Now the whole thing went belly up altogether.  The thing I find odd is that the links used by the script are still good.  Those images can be retrieved using a web browser or even an image caching script.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 678
  • BismarckWeather.net
    • BismarckWeather.net
Re: Curly's Wx Story script
« Reply #23 on: December 14, 2017, 09:26:27 AM »
Oh good.  I thought it was just me.  Mine went down about 2 days ago as well.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #24 on: December 14, 2017, 03:44:22 PM »
Ok, finally had a few minutes to look at this and it is a simple fix it seems.
In the wxStory-inc.php  script... scroll down not too far and you'll see a group of "preg_replace" like so...
Code: [Select]
$html = preg_replace('//', '&deg;', $html);                                         //  change it to an entity
  $html = preg_replace('//', '\'', $html);                                            //  change stray character
  $html = preg_replace('/<u>/', '', $html);                                            //  fix error
  $html = preg_replace('/<\/u>/', '', $html);                                          //  fix error
  $html = preg_replace('/<br>/', '<br />', $html);                                     //  fix error
 

Add these to that group...
Code: [Select]
$html = preg_replace("/\.png\?(.+?)/" , ".png " , $html);               // cut off random numbering of png
$html = preg_replace("/\.jpg\?(.+?)/" , ".jpg " , $html);               // cut off random numbering of jpg

and it should fix it. At least it did for me.
« Last Edit: December 14, 2017, 07:03:54 PM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

 

anything