Author Topic: NEWBIE to Scripts, help with rss-advisory.php  (Read 5332 times)

0 Members and 1 Guest are viewing this topic.

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
NEWBIE to Scripts, help with rss-advisory.php
« on: January 06, 2009, 06:17:51 PM »
Please be patient :oops:, I am trying to learn how to add some of Ken's great scripts to my site.  I have added to rss-advisory.php to my site and I keep getting the error 'Unable to open cache rss-advisory-VAZ026.txt for RSS data.'  Any clue of what I am doing wrong.  After I get this fixed how to do I pull up this stuff in my html webpages.  I am attempting to replace the warning page on my site as it stands.

Here is the link to the script as I have it now.
http://mountcrawfordweather.org/script/rss-advisory.php?zone=VAZ026

SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #1 on: January 06, 2009, 06:30:33 PM »
Hi Sam!

The rss-advisory.php script uses a cache file named 'rss-advisory-<zone>.txt' to save the response from the RSS feed from www.weather.gov.

You just need to create (using notepad) an empty file named 'rss-advisory-VAZ026.txt', upload it to your website,
use your website's control panel (or your FTP client) and set the permissions to 666 so it's writable by PHP.

Then run http://mountcrawfordweather.org/script/rss-advisory.php?zone=VAZ026&cache=refresh to load the cache
then the script should work normally.

Including PHP scripts into an .htm/.html page is a bit tricky, as the webserver doesn't usually parse those page types for PHP code.  The easiest way is to rename your .htm/.html page to .php which tells the PHP interpreter to parse and execute the PHP code on the page.

On the PHP page, a simple <?php include("rss-advisory.php");  ?>  will put the output of the script in your page.

More options are shown at http://saratoga-weather.org/scripts-rss.php#NOAARSS

Hope this helps, and congratulations on venturing into the great world of PHP and scripting :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #2 on: January 06, 2009, 07:39:50 PM »
Well Ken I attempted to change my file permissions, and it appears godaddy does not allow that on a windows hosting account.  So they are switching me over to linux hosting account tonight and we will see what goes from there.  That would most likely explain why other php tests of your scripts, I have done always fail.

Only php I have ever gotten to work was the ones for my sig below.
« Last Edit: January 06, 2009, 07:42:58 PM by sam2004gp »
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline prvrt

  • Contributor
  • ***
  • Posts: 128
  • WL7COQ
    • My Idaho Weather
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #3 on: January 06, 2009, 08:02:14 PM »
I had the same problem when I started mine. I had Go Daddy switch me to Linux which I later learned you can do in the control panel from your account on GoDaddy. I use FileZilla for an FTP program and changing the file permission is as easy as right clicking on the file. Good luck. Also, as someone who recently went through what you are going through, keep good notes on what you are doing where. It will help greatly in the future when you start changing things and adding things.
Davis Instruments 6163-Wireless VantagePro2 Plus w/wireless Anemometer, Software = Weather Display
Blackfoot, Idaho

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #4 on: January 06, 2009, 08:18:20 PM »
They have already copied my files to their linux server, they sent me an email with the new ip address, I guess I will most likely have some DNS migration issues over the next day or so.  When I type in my old ip or new ip, neither one of them work.  But when I retype my url, it finds my site.

SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #5 on: January 06, 2009, 08:26:54 PM »
The change to a Linux/Apache platform was a great move .. the Windows/IIS platform is always a bit strange handling (or allowing to handle) PHP files writing cache files (usually disallowed).  I think you'll be far happier on the new Linux/Apache platform.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #6 on: January 06, 2009, 09:03:45 PM »
Ok thanks, and the scripts are now working, tomorrow I will need to redesign the webpage and go from there.  I will give any DNS porting issues the night to settle.



Thanks alot Ken, I am sure I will have alot more questions, in time.  Hope your server issues work out. :-) :-)
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #7 on: January 06, 2009, 09:21:39 PM »
You're very welcome!  I'm hopeful the server is now stable.

1and1 has long periods of stability, punctuated by a screwup, but they usually get it put right in the end.
3 days of contact with their tech-support has left me fairly tired and glad it seems to be over for now.

Feel free to ask your questions .. also try the FAQ at http://saratoga-weather.org/template/template-FAQ.php :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W Thomas

  • Welcome to my area!
  • Forecaster
  • *****
  • Posts: 1647
  • In Loving Memory Of Hooker The Weather Dog !
    • Smyth-Grayson Weather
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #8 on: January 06, 2009, 10:51:57 PM »
You're very welcome!  I'm hopeful the server is now stable.

1and1 has long periods of stability, punctuated by a screwup, but they usually get it put right in the end.
3 days of contact with their tech-support has left me fairly tired and glad it seems to be over for now.

Feel free to ask your questions .. also try the FAQ at http://saratoga-weather.org/template/template-FAQ.php :)

Best regards,
Ken


I always had a terrible time understanding their accent when talking with their tech support..
I believe if I could have gotten them to actually understand what was happening they may have corrected it quicker..

Definitely a tiring process!!
Hope all is smooth sailing from here on :)
Thanks for the help the other day!


     Best Regards
     Wayne

CWOP CW8217
KVAWHITE22 Wunderground   Davis VUE &  Davis Vantage Pro 2  /   Dedicated Server
GR Level 3 ,Level 2 AE Radars  Weather Display 10.37P  Mid Atlantic Weather Network Member
SkyWarn & Spotter Network 6092

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #9 on: January 10, 2009, 12:14:34 PM »
Hey Ken, I am building some "test" pages for my site.  I was wondering if there was anyway to adjust your rss-top-warning.php to display "none" when there are no advisorys for your area, rather than just be blank?


In the settings, I see where you define the "url" when you click on the advisory message, is there a way to tell that to use that url but pull it up in my "right hand frame" of my website?    <<<<------never mind I figured it out.

Here is my test page, temporarily using a warning from PA.

http://www.mountcrawfordweather.org/test.html
« Last Edit: January 10, 2009, 12:42:26 PM by sam2004gp »
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #10 on: January 10, 2009, 01:01:40 PM »
If you click on the warning message in the banner frame above it will pull up my warning page.  The "warning" menu selection on the left hand side is from my "current" vws generated design.
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #11 on: January 10, 2009, 01:29:58 PM »
Hi Sam,

To have rss-top-warning.php display 'None' when there are no warnings, just change
Code: [Select]
$warnscroll = ""; to
Code: [Select]
$warnscroll = '<div>None</div>';
Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #12 on: January 10, 2009, 01:47:10 PM »
Oh okay, thanks ken, If I looked harder I would have found it. :oops:  I will be sure to get a link to your site once I get all my scripts and pages customized.

The whole reason I am using your scripts is because VWS keeps dieing on my warning downloads. Plus I need to learn more about this stuff anyways.  But per Ed's recommendation I can upgrade to VWS 14.0 but then I would no longer be able to use the tag know as "hourly rain" because he changed it's meaning in that version.

http://www.wxforum.net/index.php?topic=2831.0

SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #13 on: January 12, 2009, 11:51:36 AM »
The php script is installed in my website and is working great. :grin: :grin: \:D/ \:D/
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #14 on: January 17, 2009, 09:49:36 AM »
Hi folks,

Ok, stupid question time.  Where does one insert the PHP to make the RSS Warning work on the index page?  I'm looking but......  I"m probably blind and not seeing it.

Thanks,  John
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline sam2004gp

  • Mount Crawford, Virginia
  • Forecaster
  • *****
  • Posts: 2865
  • Weeeeeeeee!!!!
    • Mount Crawford Weather, VA
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #15 on: January 17, 2009, 10:29:27 AM »
In my case assuming your webhoster supports php, you have to rename your page to anynamehere.php file, and then include the "call" for the php script in your page.  Here is an example of mine...

Quote
.....
<th width="302" rowspan="2" class="style4" scope="col"><table border="0" align="center" cellspacing="0">
      <tr>
        <td width="276"><span class="style20"><font face="Arial">Current Weather Warnings &amp; Advisories</font></span></td>
      </tr>
      <tr>
        <td bgcolor="#FFFF00"><span class="style26"><font face="Arial"><span class="style27"> </span>
          <?php include("http://www.mountcrawfordweather.org/script/rss-top-warning.php"); ?></font></span></td>
      </tr>
      </table></th>
SAM --->>> http://www.mountcrawfordweather.org
OS WMR-968 with a Dedicated PWS Weather Computer running VWS v13.01 p09


Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: NEWBIE to Scripts, help with rss-advisory.php
« Reply #16 on: January 17, 2009, 10:44:04 AM »
Thanks Sam.  I am blind.  Need some more caffeine.

John

Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

 

anything