Author Topic: wxStory 3.0  (Read 5904 times)

0 Members and 1 Guest are viewing this topic.

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: wxStory 3.0
« Reply #25 on: April 13, 2022, 07:47:47 AM »
Thanks Jim.  Glad to help.
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joes Weather
Re: wxStory 3.0
« Reply #26 on: April 13, 2022, 10:00:12 AM »
Just installed this and I am getting a bunch of errors. Can you tell me what I have done wrong?



Warning: fopen(./wscache/wsimg_iln_weatherstory.png): failed to open stream: No such file or directory in /home/joes/www/www/wxStory_inc.php on line 256

Warning: fwrite() expects parameter 1 to be resource, bool given in /home/joes/www/www/wxStory_inc.php on line 257

Warning: fclose() expects parameter 1 to be resource, bool given in /home/joes/www/www/wxStory_inc.php on line 258

Warning: Division by zero in /home/joes/www/www/wxStory_inc.php on line 680

Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in /home/joes/www/www/wxStory_inc.php on line 681

Warning: imagecopyresampled() expects parameter 1 to be resource, null given in /home/joes/www/www/wxStory_inc.php on line 682

Warning: imagedestroy() expects parameter 1 to be resource, null given in /home/joes/www/www/wxStory_inc.php on line 694

Warning: fopen(./wscache/wsdata_iln.php): failed to open stream: No such file or directory in /home/joes/www/www/wxStory_inc.php on line 479
WEATHER STORY
Wilmington
Weather Forecast Office

Warning: include(wxStory_drop_inc.php): failed to open stream: No such file or directory in /home/joes/www/www/wxStory_inc.php on line 718

Warning: include(): Failed opening 'wxStory_drop_inc.php' for inclusion (include_path='.:/usr/local/php73/lib/php') in /home/joes/www/www/wxStory_inc.php on line 718
Weather Story
Data Courtesy of Wilmington Weather Forecast Office[/color]



Thanks,
Joe
www.joesweather.info
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: wxStory 3.0
« Reply #27 on: April 13, 2022, 10:32:43 AM »
First thing to check is that you created the wscache directory and the path matches that in the script.  From your output it looks like it should be
/home/joes/www/www/wscache
Second, make sure there is write permission to that directory so the script can create the files.
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: wxStory 3.0
« Reply #28 on: April 13, 2022, 10:39:02 AM »
Also, looks like you didn't install wxStory_drop_inc.php
You need to get the entire zip file from earlier in the thread, not just the latest .txt file.  There are more instructions in the .zip
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joes Weather
Re: wxStory 3.0
« Reply #29 on: April 13, 2022, 11:22:01 AM »
Thank you, Dan.

You are correct, the only script I downloaded and installed is wxStory.php

Ill complete the installation a little later on today.

Joe
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline Jumpin Joe

  • Forecaster
  • *****
  • Posts: 1073
    • Joes Weather
Re: wxStory 3.0
« Reply #30 on: April 13, 2022, 01:12:00 PM »
Completed the installation of ALL the folders and files.

Life is good.

Thanks again, Jim and Dan!
Joe
https://joesweather.info
Davis Vantage Pro 2 Plus 24-FARS Wireless
WeatherLink Live

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #31 on: April 15, 2022, 02:40:50 PM »
Attached is version 3.05 which adds a configuration item for validation.  <script type="text/javascript"> is not allowed in HTML5. 

It also cleans  up the WFO array which was missing some spaces in the WFO names.

- Jim.

Forum Search and Google Can be Your Best Friends

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: wxStory 3.0
« Reply #32 on: April 18, 2022, 12:45:02 PM »
Hi Jim

Been playing with the script some more.  I noticed a couple times that I would get
the show/hide caption button, but no text.

Today Caribou Maine is showing a story image and caption on there site, but $wsdata ends up as a zero length string in the script.  Not been able to figure out when the script isn't able to find the caption (finding the cases when it doesn't work has been trial and error).  Haven't tried to dig into all the page parsing code.
    - Dan
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #33 on: April 19, 2022, 04:46:35 AM »
Dan,

There are some of the eastern sites that never have any notes.  Then there apparently are some that are sporadic.  I should be able to insert a "not available" note when they don't have one.  Busy today but should be able to work on it tomorrow.  Thanks for finding these things.

- Jim

Forum Search and Google Can be Your Best Friends

Offline drrehak

  • Senior Member
  • **
  • Posts: 51
Re: wxStory 3.0
« Reply #34 on: April 19, 2022, 09:27:49 AM »
Hi Jim,

Thanks.  No rush at at -- whenever you get to it.

In this case, the problem isn't their site, its the script.
Here a screen grab of what Caribou is showing today -- includes the note.


And here's their HTML:
Code: [Select]
<body><pre style="word-wrap: break-word; white-space: pre-wrap;">Gusts to 65 mph from east/southeast near the coast today. Heavy rain Downeast from ~7am-2pm. Locally 3” rain could fall in just a few hours. Minor coastal flooding around the early afternoon high tide.
Northern Maine, snow and sleet totals generally &lt;1”, except higher amounts over higher elevations. Changing to rain by early afternoon.
</pre></body>

And here's what the script generates:
Code: [Select]
<?php

$mainStory 
= array (
  &
#39;WeatherStory&#39; => 
  
array (
    
=> &#39;&#39;,
    
=> &#39;&#39;,
    
=> &#39;https://www.weather.gov/images/car/WeatherStory.gif&#39;,
    
=> &#39;https://www.weather.gov/car/&#39;,
    
=> &#39;./wscache/wsimg_car_WeatherStory.gif&#39;,
    
=> &#39;gif&#39;,
    
=> &#39;WeatherStory&#39;,
    
=> &#39;car&#39;,
    
=> &#39;Caribou&#39;,
  
),
);

$altStory = array (
);

$nfo = &#39;Caribou&#39;;

$hdlnr = array (
  
=> &#39;     <td style="text-align: center; background-color:#F0F7FF; padding: 6px 0px 6px;"><a href="/weather/st/wxstory.php?i=car&amp;ifn=WeatherStory" title="" style="text-decoration: none; color: #0071BC; font-size: 1.3em;">Weather Story</a></td>&#39;,
);


?>


From what I can tell, array[1] shouldn't be empty.  Something wrong it parsing.
I do see that this site is wrapping the caption in a <pre> unlike other sites.
And they have the "" in the output.  I've not be able to figure out all the
script code to tell if this is the problem.

If $wsdata is legitimately empty, adding a strlen around the row will turn it and the button off, but that's not what should happen here.
Code: [Select]
<?php if(strlen($wsdata)>0){ ?>
 <tr>

<?php if ($UseShowHide) { ?>
 <td> <!-- align was center -->
 <div id="myDIV" style = "width: <?php echo $tablewdth?>px;text-align: left;background-color: white;margin-top: 5px; display: <?php echo $CDisplay?>;">
<?php echo $wsdata?>
</div>
 <button id="myButton" style="float: left;background-color: #0071BC; margin-top: 5px; padding: .3em; -moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 6px;color: white;font-size: 12px; font-weight:600; text-decoration: none; border: none; " onclick="myFunction()"> <?php echo $CCaption;?>  </button>
 </td>
<?php } else { ?>
  <td style="text-align:justify; line-height: 160%;"><?php echo $wsdata?></td>
<?php ?> 
 </tr>
<?php ?>

    - Dan
Dan Rehak | Pittsburgh PA
Davis Vantage Pro 2 Plus | Meteobridge Pro
Local Site | Raspberry Pi 4B

Offline zeppline

  • Senior Member
  • **
  • Posts: 50
    • Las Vegas Weather Guy
Re: wxStory 3.0
« Reply #35 on: April 19, 2022, 08:40:21 PM »
I downloaded wxstory and it working except I can not get the map to load. it is in images/WS_map but the program can't find it. If I use the web "lasvegaswx.com/images/WS_map" it is there? What am I missing.  Thanks Joe

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #36 on: April 19, 2022, 09:29:06 PM »
Joe, the map file must be named WS_map.png.  Give that a try.  - Jim

Forum Search and Google Can be Your Best Friends

Offline zeppline

  • Senior Member
  • **
  • Posts: 50
    • Las Vegas Weather Guy
Re: wxStory 3.0
« Reply #37 on: April 19, 2022, 10:02:40 PM »
Thanks Jim after 3 days I new it was something small. I thought the program added the png. I know enough to get in trouble. Thanks again Joe

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #38 on: April 20, 2022, 07:34:06 AM »
I'm glad you got it working Joe.

Attached is Ver 3.06 that takes care of the eastern stations that had no captions/notes.    Thanks for catching this too Dan.

Forum Search and Google Can be Your Best Friends

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 546
    • Up Country Maui Weather
Re: wxStory 3.0
« Reply #39 on: April 21, 2022, 02:30:17 PM »
Hi All,

Thanks Jim for updates.  It  is too bad that Hawaii and Alaska are not included with this scripts yet.

Aloha,

--Stan Y.
   Maui, Hawaii
Stan Y. - KH6HHG - Maui, Hawaii
 --- Blitzortung ID: 993
 --- FlightRadar24 ID: F-PHOG1

WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
Webcam: Axis 211

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #40 on: June 15, 2022, 07:31:45 PM »
I've updated the .zip in the first post to V3.07.  The map and script were updated after tracking WFO performance for over 3 months.  Basically, Reno turned yellow.  - Jim

Stan, I'd love to add those sites if they ever participate.

Forum Search and Google Can be Your Best Friends

Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 546
    • Up Country Maui Weather
Re: wxStory 3.0
« Reply #41 on: June 16, 2022, 12:57:27 AM »
Thanks Jim for the update and hope one of these days the NWS office here will participate as well as Alaska.

Aloha,

--Stan Y.
   Maui. Hawaii
Stan Y. - KH6HHG - Maui, Hawaii
 --- Blitzortung ID: 993
 --- FlightRadar24 ID: F-PHOG1

WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
Webcam: Axis 211

Offline hunter362

  • Member
  • *
  • Posts: 9
    • Fairmount Hill's Weather
Re: wxStory 3.0
« Reply #42 on: June 28, 2022, 10:52:22 PM »
Joe, the map file must be named WS_map.png.  Give that a try.  - Jim
Jim, I've got a similar issue with the map being drawn, here's the error I'm getting:  [ You are not allowed to view attachments ]

Unable to open  './images/Ws_map_bgm.png' for writing: Permissiom denied in wxStory_inc.php line 158

permissions are 644 on the images

Viewing source I get a 404 error
!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /images/WS_map_bgm.png was not found on this server.</p>
</body></html>

What am I missing here?
« Last Edit: June 28, 2022, 10:54:20 PM by hunter362 »

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #43 on: June 29, 2022, 05:52:45 AM »
Bill,

I'm running the script on two different servers and the images are 0644 on both.  The images folder itself is set 0755, maybe you can check that?

Please post the url of the file that is including wxStory_inc.php, or upload weather-story-test.php So I can test from here.

- Jim

Forum Search and Google Can be Your Best Friends

Offline hunter362

  • Member
  • *
  • Posts: 9
    • Fairmount Hill's Weather
Re: wxStory 3.0
« Reply #44 on: June 29, 2022, 09:21:26 AM »
Jim,
Images folder is 0755, changed folders, changed all images to 0777, still get the same error

PHP 5.5.9-1ubuntu4.29+esm15 (cli) (built: Oct 27 2021 18:41:06)

http://www.camillusweather.com/weather-story.php

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1223
  • BismarckWeather.net
    • BismarckWeather.net
Re: wxStory 3.0
« Reply #45 on: June 29, 2022, 11:51:04 AM »
I'm not sure how the script works to pull my images, but they aren't showing.  I'm getting the headers correct, just not showing the pictures.

https://www.weather.gov/bis/weatherstory
https://www.bismarckweather.net/wxstory.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #46 on: June 30, 2022, 06:51:45 AM »
Right now, I'm clueless as to why these two different problems are happening.  I suggest that we start by making sure we're all on the most recent version of the wxStory_inc.php script.  Version 3.07 is in the first post in this thread.

- Jim

Forum Search and Google Can be Your Best Friends

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1223
  • BismarckWeather.net
    • BismarckWeather.net
Re: wxStory 3.0
« Reply #47 on: June 30, 2022, 08:44:29 AM »
I just re-downloaded and configured mine again.  Pictures are still MIA.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: wxStory 3.0
« Reply #48 on: June 30, 2022, 09:21:27 AM »
92merc, please try using a ftp program such as Filezilla and clear everything out of your wscache folder and see if that helps.

hunter362, any chance of creating a new images folder with just WS_map.png in it?

- Jim

Forum Search and Google Can be Your Best Friends

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1223
  • BismarckWeather.net
    • BismarckWeather.net
Re: wxStory 3.0
« Reply #49 on: June 30, 2022, 09:34:51 AM »
527 files cleared from cache.  Issue persists.
wsdata_bis.php, wsdata_grr.php showed up after I tested the page.  Plus a couple of matching wsimg files.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

 

anything