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

0 Members and 1 Guest are viewing this topic.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 671
  • BismarckWeather.net
    • BismarckWeather.net
Re: Curly's Wx Story script
« Reply #25 on: December 14, 2017, 04:09:38 PM »
That fixed mine up as well.
http://www.BismarckWeather.net
Davis VP2, Cumulus, Blitzortung, Bloomsky, Saratoga Scripts

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 225
Re: Curly's Wx Story script
« Reply #26 on: December 14, 2017, 04:35:07 PM »
Nice work!  That seems to have restored it for most people but if you select North Webster (Indiana) then you get nothing.  The images are there so I don't know what's up with that.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2007
    • SouthEast Lincoln, NE Weather
Re: Curly's Wx Story script
« Reply #27 on: December 14, 2017, 06:47:03 PM »
Nicely done!  Even 'Northern Indiana' is showing up for me right now.  It looks as though some WFO's have resorted to the '?timestamp' appended to the end of some graphics in order to thwart browser caching.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #28 on: December 14, 2017, 07:02:35 PM »
I also just noticed that some sites use .jpg for their images.
So add this line in the same place as well....
Code: [Select]
$html = preg_replace("/\.jpg\?(.+?)/" , ".jpg " , $html);               // cut off random numbering of jpg
I've also added that to the code in my earlier post.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline Fox_Of_The_Wind

  • Forecaster
  • *****
  • Posts: 390
  • Hi there!
    • http://www.desotowiwx.com
Re: Curly's Wx Story script
« Reply #29 on: December 14, 2017, 09:39:47 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('//', '°', $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.

Thank you. Mine is working great again!

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 225
Re: Curly's Wx Story script
« Reply #30 on: December 15, 2017, 10:42:45 AM »
I hope what I found helps someone eventually.  I will say that I am not skilled enough in php to be able to explain why most every site worked but a few, even after the fixes by RRRICK8 but they didn't.  ("Northern Indiana" is the one I was focused on.)  I was able to prove that the image was being retrieved but that the script wasn't processing it.  I learned that by replacing


Code: [Select]
$imgName   = '';

with this

Code: [Select]
$imgName   = array();

that the KIWX image suddenly began displaying correctly.  Why other sites worked before I don't know but I'd like to learn about it.  The wild card here is that I am using PHP 7.2.  There are a number of changes that affect our scripts in that version.



Offline jgillett

  • Forecaster
  • *****
  • Posts: 1155
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: Curly's Wx Story script
« Reply #31 on: December 15, 2017, 11:07:36 AM »
Mine now working fine, images and all. Unfortunately Phoenix isn't posting the story right now but have a call in to the PSR manager to see if he'll get it going again.

Thanks to all.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #32 on: December 15, 2017, 12:33:23 PM »
On my site I've also updated the WS_map.png   to reflect some of the WFO's that were indicated as seldom used are now using the Weather Story daily or almost daily.  I've changed those that have it 3 days in a row at least that I've checked.
If you want to replace it, just download it here and then upload it to your directory where you have it in your script.
« Last Edit: December 15, 2017, 02:50:03 PM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline East Cobb Weather

  • Signature
  • Contributor
  • ***
  • Posts: 130
    • East Cobb Weather
Re: Curly's Wx Story script
« Reply #33 on: December 18, 2017, 02:22:36 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
 


Any other ideas? This didn't work for me.... :(
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.
Eric
Marietta, GA
East Cobb Weather
http://www.eastcobbweather.com


Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #34 on: December 18, 2017, 02:57:24 PM »
Looks like it's all working except the first radar tab.
That gif image adds another dimension to it.

Along with the .png and .jpg replace we need to add .gif to the mix.
So add gif to the solution....
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
 $html = preg_replace("/\.gif\?(.+?)/" , ".gif " , $html);               // cut off random numbering of gif
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #35 on: December 18, 2017, 03:12:57 PM »
On my site I've also updated the WS_map.png   to reflect some of the WFO's that were indicated as seldom used are now using the Weather Story daily or almost daily.  I've changed those that have it 3 days in a row at least that I've checked.
If you want to replace it, just download it here and then upload it to your directory where you have it in your script.


As a side... I've notice the last few days (that I've been monitoring) that even the few remaining orange "Seldom Used" have been working except Boise. As of time of this posting, both Arizona sites, Medford OR., and Washington is working and has been for the most part the last few days. Portland (which is labeled red- not used) is even using theirs today. So I might be updating this map again in a few days.
 [ You are not allowed to view attachments ]
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 440
    • Up Country Maui Weather
Re: Curly's Wx Story script
« Reply #36 on: December 18, 2017, 03:17:20 PM »
Hi All,

Looks like this scrip will not work for me or folks in Alaska.  Hawaii and Alaska are not included in the mix.

Looks good for the CONUS (Lower 48) though.

Maybe one day we will be included.

Regards,

--Stan Y.
   Maui, Hawaii
Stan Y. - KH6HHG - Maui, Hawaii --- Blitzortung ID: 993 --- FlightRadar24 ID: F-PHOG1
Weather Display 10.37s Build 70
WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
1-Wire Lighting
Webcam: Axis 211

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #37 on: December 18, 2017, 03:28:58 PM »
Hi All,

Looks like this scrip will not work for me or folks in Alaska.  Hawaii and Alaska are not included in the mix.

Looks good for the CONUS (Lower 48) though.

Maybe one day we will be included.

Regards,

--Stan Y.
   Maui, Hawaii

Yeah, I don't see a Weather Story on any of the WFO's for those areas. 
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #38 on: December 18, 2017, 05:58:26 PM »
Quote
Warning: imagecreatefrompng(): './images/WS_map.png' is not a valid PNG file in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 279

Warning: getimagesize(): PNG file corrupted by ASCII conversion in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 280

Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 281

Warning: imagecolortransparent() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 282

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 283

Warning: imagecreatefrompng(./images/ind.png): failed to open stream: No such file or directory in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 284

Warning: imagecopymerge() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 285

Warning: imagedestroy() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 286

Warning: imagepng() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 287

Warning: imagedestroy() expects parameter 1 to be resource, boolean given in /home/hj2ke8lfpx43/public_html/wxStory_inc.php on line 288

not sure what i did wrong i just changed

//  MAP & DATA SETTINGS
$useWFOmap      = true;               // true=use map to select WFO     false=use drop down menu to select the WFO
$ws_mapfolder   = './images/';         // main map image file FOLDER
$ws_cachefolder = './wscache/';        // cache file FOLDER
$wfomaps        = './images/';       // folder containing individual WFO coverage maps
$mapname        = 'WS_map';            // main map name - without extension
$ift            = '.png';              // map image file extesion
$autocacheclean = true;                // true=auto delete cache files older than 1 day   false=keep cache files
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #39 on: December 18, 2017, 06:04:05 PM »
So what did you change there?
Only thing I see different than mine is the $wfomaps folder location.
Mine is $wfomaps        = './wsimages/';
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #40 on: December 18, 2017, 06:06:03 PM »
So what did you change there?
Only thing I see different than mine is the $wfomaps folder location.
Mine is $wfomaps        = './wsimages/';

was there a zip for wxstory cuz i dont have wsimages?
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #41 on: December 18, 2017, 06:07:38 PM »
So what did you change? You said you changed that section.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #42 on: December 18, 2017, 06:08:26 PM »
So what did you change? You said you changed that section.

Just False to true on $useWFOmap      = true;               // true=use map to select WFO     false=use drop down menu to select the WFO
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #43 on: December 18, 2017, 06:13:03 PM »
Change it back to false to see if your errors go away.
I suspect that you didn't upload the WFOmaps folder or it's in a different location.
« Last Edit: December 18, 2017, 06:19:09 PM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #44 on: December 18, 2017, 06:23:57 PM »
Change it back to false to see if your errors go away.
I suspect that you didn't upload the WFOmaps folder or it's in a different location.

There was never a WFOmaps folder where do i get one at? I changed it back and i had no errors.
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #45 on: December 18, 2017, 06:38:08 PM »
Here is the original zip I have. Don't know for sure if this is the one that Curly released because I was doing some beta testing for him on a few scripts and I believe this was one of them.
If you do a complete new reload, make sure to add the preg_replace changes posted earlier...
 [ You are not allowed to view attachments ]
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #46 on: December 18, 2017, 06:40:20 PM »
Here is the original zip I have. Don't know for sure if this is the one that Curly released because I was doing some beta testing for him on a few scripts and I believe this was one of them.
If you do a complete new reload, make sure to add the preg_replace changes posted earlier...
 [ You are not allowed to view attachments ]

Ok thanks :)
« Last Edit: December 18, 2017, 06:44:59 PM by mkutche »
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #47 on: December 18, 2017, 06:45:10 PM »
This is crazy I still get the errors lol
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------

Offline rrrick8

  • Contributor
  • ***
  • Posts: 136
    • Vermilion weather
Re: Curly's Wx Story script
« Reply #48 on: December 18, 2017, 06:52:33 PM »
This is crazy I still get the errors lol

Did you upload everything like the Readme file instructed?
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline mkutche

  • Forecaster
  • *****
  • Posts: 792
    • GosportWx.com
Re: Curly's Wx Story script
« Reply #49 on: December 18, 2017, 06:54:20 PM »
Yep im wondering if its because of PHP 7
Mike K.
WS2080 - Cumulus MX v3.0.0
Gosport, Indiana
Gosportwx.com Gosportwx.com/PWS/ Gosportwx.com/j-template/ twitter.com/GosportINWX facebook.com/GosportWxcom
-----------------------------------------------------------