They're free, but use at your own risk
The scripts in PHP and Perl referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular station website.
A RSS Feed is available to help keep you informed on updates to the scripts.
A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums as they become available.
This page was updated
Tuesday, 15-Sep-2009 4:52 PM
Your Weather Website - considerations
Now that you've decided to create your own weather website to show weather conditions in your area, here are a few things to consider before you start to implement the PHP template set:
Hosting and domain name
- If you have a choice between Windows/IIS or Linux/Apache hosting, I strongly recommend you go with Linux/Apache -- there have been numerous instances where the Windows/IIS/PHP installations required extra fiddling with the code to make it work, while with Linux/Apache hosting, that is seldom the case.
- Do sign up for paid hosting - the free PHP hosting sites generally have restrictions on what will be allowed, and also tend to add extra code to your pages (to advertise their free hosting) which will make image processing PHP scripts (like the thermometer.php) not work at all. Their extra HTML added to your pages will also tend to make the pages not-valid when run against the HTML validators. Best to avoid the 'free' hosting.
- Do get your own domain name for your website from a 'big name' registrar like GoDaddy, HostGator, 1and1, Network Solutions. Yes, it can be part of a package (hosting+domain name), but make sure it is a hoster that is likely to remain in business. Many folks have suffered loss of service when their domain registrar has gone bankrupt. Make sure you have 'auto-pay' set up with your domain registrar, so when your domain is up for renewal, it won't expire due to non-payment. Recovering an expired domain name is very difficult, and may be impossible if a domain-squatter snaps it up before you can get it renewed. Also make sure your hoster is on 'auto-pay' too.
- For hosters, consider e-rice.net, godaddy.com, hostgator.com, 1and1.com, but be sure to specify the Linux/Apache package.
- If you must host your own website on a PC, I'd recommend you use XAMPP all-in-one Apache/mySQL/PHP on the system. Be aware that such hosting may violate the terms-of-service with your internet ISP, and generally, it is less 'safe' to host on your own system than to have a professional hosting company who are responsibile for the security configuration of your website. I use XAMPP for testing stuff, but only access it locally on my home network behind my firewall router .. it is not offered to the internet at all.
Use a local master of the website to configure/maintain
- Unlike the HTML-only template set where all the HTML files must be uploaded regularly by Weather-Display to have the %wdtags% be processed for weather condition variables, the PHP template set is uploaded once to your website, and all the weather variables are contained in the testtags.php file and used by the templates to display the weather conditions wherever they are needed. So, you have to setup Weather-Display to upload testtags.txt as testtags.php on a regular interval, and for the AJAX updates, Weather-Display needs to upload the clientraw.txt file through the clientraw-realtimeftp process. Other Weather-Display generated files are also needed for display and they are enumerated in the FAQ
- Create a directory on the system you'll use to maintain the master copy of your PHP files for your website and unpack the contents of the distribution .zip files into that directory. The exact distribution .zip files required depends on which of the five template sets you choose to implement. If you ever want to make your website multilingual, install the multilingual version when you start as it is very difficult to upgrade to multilingual from a English-only template. Make sure you preserve the internal directory structure for the templates. Use this offline directory as the 'document root' for your website. Upload ALL the files and directories to your website with a good FTP client program (like FileZilla). It's important to have the FTP client upload all files in ASCII mode EXCEPT the graphics files (.gif, .jpg, .png) which must be uploaded in BINARY mode.
- Do the editing and configuration of Settings.php on your offline master copy of your website, then upload to your website. Don't use file editors associated with a cPanel on your site, as they will tend to convert the text to UTF-8 and cause 'funny characters' to appear in odd places on your website. Be aware that some WYSIWYG HTML editors (like FrontPage/Expressions Web) are not always 'kind' to PHP pages, so use notepad to edit PHP pages if your pages don't work correctly after upload. I use Adobe CS4 Dreamweaver and notepad++ to edit my pages. There are many PHP-friendly HTML editors out there (both free and purchased).
- After you upload and try out your new website, you may find that some features are not working as expected, and some content is missing. Do a 'view source' on the page that is having the problem, and you may see messages in HTML comments in the page that show what the error is. Usually, the problem is missing or unwritable cache files needed by the support scripts. These messages look like this:
<!-- rss-top-warning.php - V1.04 06-Apr-2008 -->
<!-- getting cache from http://www.weather.gov/alerts/wwarssget.php?zone=WAZ504 -->
<!-- unable to write rss-advisory-WAZ504.txt -->
<!-- get-UV-forecast-inc.php V1.03 - 03-Jul-2009 -->
<!--Unable to write cache ./uv-forecast.txt -->
<!-- advforecast2.php - V2.14 - 14-Jan-2009 -->
<!-- NWS URL: http://forecast.weather.gov/MapClick.php?site=mtr&smap=1&textField1=46.58490&textField2=-122.90424&TextType=2 -->
<!-- zone=WAZ504 -->
<!-- unable to write cache file forecast.txt -->
<!-- quake-USA.php V1.09 03-Jul-2009 -->
<!-- server lcl time is: Mon, 14-Sep-2009 7:25am PDT -->
<!-- server GMT time is: Mon, 14-Sep-2009 2:25pm GMT -->
<!-- server timezone for this script is: -->
<!-- TZ Delta = -25200 seconds (-7 hours) -->
<!-- loading quakesUSA.txt from http://earthquake.usgs.gov/eqcenter/recenteqsus/Quakes/quakes_all.php -->
<!-- unable to write cache file quakesUSA.txt -->
To fix the issue, create a blank file using notepad or other plain text editor, Save As.. the file with the name listed (for the examples above
rss-advisory-WAZ504.txt, uv-forecast.txt, forecast.txt and quakesUSA.txt are the needed files), then upload the files to your website. The exact filenames vary by template set (USA example above, Canada and World have different cache file names). You may also have to set the file permissions for those files to 666 (write/read all) for PHP to be able to write to them. When this is done, try the pages having the problem again .. it may take from 5 to 30 minutes for some of the pages to fill the cache file with new content, but then will work consistently.
Please see the FAQ for a list of cache files needed based on your template type.