<?php

$url = 'http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html';
$handle = fopen($url, "r");
$weather = file_get_contents($url);
fclose($handle);

/**
 *
 *	Clean up the retrieved HTML code
 *	
 *  We clean up the source we got here.  Basically, we only want a section
 *  of the code.  We only need the working weather section.  So we cut out
 *  the meat, starting at '<div id="citybanneradright" class="right">' and
 *  ending at '<div id="cityadditional">' which will give us just the info
 *  about the current conditions.  Exactly what we want!!
 *
 */
$weather = substr($weather, strpos($weather, '<div id="citybanneradright" class="right">'), (strpos($weather,'<div id="cityadditional">')-strpos($weather, '<div id="citybanneradright" class="right">')));
$weather = substr($weather, strpos($weather, '<h1>'), ((strpos($weather, '</dl>')-strpos($weather, '<h1>'))+5));

/**
 *  PERL RegEx Pattern to match
 *	
 *	The pattern of what the HTML will look like each time that page is hit
 *	by us (or any other viewer).  We define areas with parenthesis "()"
 *	and what their values can contain with ranges "[a-zA-Z]".
 *	Research Regular Expressions if you don't understand.
 *
 */
 $pattern = "@<h1>
              <a name=\"content\">&nbsp;</a>([-\s\w]*)</h1>

        <div id=\"city\">
          <div id=\"box\">
            <div id=\"citycurrent\">
              <h2>Currently</h2>
              <div id=\"cityobserved\">([-\w\s\:]*)</div>
              <dl>
                <dt>Temperature</dt>

                <dd>([- \d]*) &deg;([F|C]{1})</dd>
                <dd class=\"dd1\"/>
                <dt>Pressure/ Tendency</dt>
                <dd>([- \d\.]*) kPa<span class=\"[- \w]*\" id=\"[- \w]*\">([&;\w]*)</span></dd>
                <dd class=\"dd1\"/>
                <dt>Humidity</dt>

                <dd>([\d]*) %</dd>
                <dd class=\"dd1\"/>
                <dt>Dewpoint</dt>
                <dd>([-\d]*) &deg;([F|C]{1})</dd>
                <dd class=\"dd1\"/>
                <dt>Wind</dt>

                <dd>([ \w\n\/\t]*)</dd>
                <dd class=\"dd1\"/>
              </dl>@";

preg_match($pattern, $weather, $info);
preg_match_all($pattern, $weather, $info2);
?>

<pre>
<?php 
var_dump($info);
echo '<hr>';
var_dump($info2);
?>

</pre>

That's what I came up with. For some odd reason, the RegEx doesn't work, not sure why. If you put it in a RegEx checker (like the one from the makers of PHPEdit), it works perfectly!! But I couldn't get my local server (PHP5, Apache 2) to do it. I could go line-by-line with regex, but that was too tedius. preg_match_all should work with this pattern, but for some odd reason, it doesn't. Maybe someone else can figure it out.

$me->Racking_his_brain_as_he_goes_to_get_drunk(...)

~Brett

    This is what happens when I use the code in my server...how can I fix this?

    array(0) {
    }
    --------------------------------------------------------------------------------array(11) {
    [0]=>
    array(0) {
    }
    [1]=>
    array(0) {
    }
    [2]=>
    array(0) {
    }
    [3]=>
    array(0) {
    }
    [4]=>
    array(0) {
    }
    [5]=>
    array(0) {
    }
    [6]=>
    array(0) {
    }
    [7]=>
    array(0) {
    }
    [8]=>
    array(0) {
    }
    [9]=>
    array(0) {
    }
    [10]=>
    array(0) {
    }
    }

      aep wrote:

      the above code does not work, page is all white...no data was loaded.

      oh yeh i didnt test it.. change

      foreach ($xml->item as $item)
      to
      foreach ($xml->channel->item as $item) 
      
      aep wrote:

      What php code did you use to create the graphs on weather world? And is it possible to make them for Canada and the U.S.A?

      Umm yeh you could do one of the entire planet (if you really wanted to.)

      i used wunderground.com's rss feeds they seem to have a least 1 city in most countrys.

      doing the graph is simple i simply have a hourly cron which gathers infomation from wunderground and stores it on my server (its really primative( my 1st php project 🙂 never really finished it though)) that graph and temperature map were drawn with GD image functions...

        It still is not working...Parse error: parse error, unexpected '}' in C:\Sites\Single25\litohin\webroot\solar1.php on line 9

        <? 
        $xml = simplexml_load_file('http://www.weather.gov/alerts/ny.rss'); 
        
        foreach ($xml->channel->item as $item) 
        echo $item->title."<br>"; 
        echo $item->link."<br>"; 
        echo $item->description."<br>"; 
        echo '<hr>'; 
        } 
        
        ?>
          foreach ($xml->channel->item as $item) 

          SHould be:

          foreach ($xml->channel->item as $item){

          ~Brett

            HAH!!! I got it.....

            <?php
            
            $url = 'http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html';
            $handle = fopen($url, "r");
            $weather = file_get_contents($url);
            fclose($handle);
            
            /**
             *
             *	Clean up the retrieved HTML code
             *	
             *  We clean up the source we got here.  Basically, we only want a section
             *  of the code.  We only need the working weather section.  So we cut out
             *  the meat, starting at '<div id="citybanneradright" class="right">' and
             *  ending at '<div id="cityadditional">' which will give us just the info
             *  about the current conditions.  Exactly what we want!!
             *
             */
            $weather = substr($weather, strpos($weather, '<div id="citybanneradright" class="right">'), (strpos($weather,'<div id="cityadditional">')-strpos($weather, '<div id="citybanneradright" class="right">')));
            $weather = substr($weather, strpos($weather, '<h1>'), ((strpos($weather, '</dl>')-strpos($weather, '<h1>'))+5));
            
            
            /**
             *  PERL RegEx Pattern to match
             *	
             *	The pattern of what the HTML will look like each time that page is hit
             *	by us (or any other viewer).  We define areas with parenthesis "()"
             *	and what their values can contain with ranges "[a-zA-Z]".
             *	Research Regular Expressions if you don't understand.
             *
             */
             $pattern = "@<h1>[\s\n]*<a name=\"content\">&nbsp;</a>([\w\s\-.]*)</h1>[\s\n]*<div id=\"city\">[\s\n]*<div id=\"box\">[\s\n]*<div id=\"citycurrent\">[\s\n]*<h2>Currently</h2>[\s\n]*<div id=\"cityobserved\">([\w\-\s\:]*)</div>[\s\n]*<dl>[\s\n]*<dt>Temperature</dt>[\s\n]*<dd>([\d\-.]*) &deg;([F|C]{1})</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Pressure/ Tendency</dt>[\s\n]*<dd>([\d\.\-]*) kPa<span class=\"[\w]*\" id=\"[\w]*\">([\w&;]*)</span></dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Humidity</dt>[\s\n]*<dd>([\d\-.]*) %</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Dewpoint</dt>[\s\n]*<dd>([\d\-]*) &deg;([F|C]{1})</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Wind</dt>[\s\n]*<dd>([\w\-\n\/\t\:\s.]*)</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*</dl>@m";
            
            preg_match($pattern, $weather, $info);
            
            /**
             *  Remove the first array element
             *
             *  We remove the first element so that we can loop through the array and get
             *  only the values we need, minus the formatting so we can format it how we like.
             *  You can comment out the line and see the differences for yourself.
            */
            
            array_shift($info);
            ?>
            
            <pre>
            <?php 
            var_dump($info);
            ?>
            </pre>

            THat will give you what you want if you don't want to use the XML thing. It outputs the following:

            array(10) {
              [0]=>
              string(12) "Chatham-Kent"
              [1]=>
              string(51) "Observed at: Ridgetown 31 December 2005 1:00 PM EST"
              [2]=>
              string(1) "2"
              [3]=>
              string(1) "C"
              [4]=>
              string(5) "100.4"
              [5]=>
              string(6) "&#8593;"
              [6]=>
              string(3) "100"
              [7]=>
              string(1) "2"
              [8]=>
              string(1) "C"
              [9]=>
              string(12) "WSW 13 km/h "
            }
            foreach ($xml->channel->item as $item) 

            SHould be:

            foreach ($xml->channel->item as $item){

            ~Brett

            ~Brett

              Thanks a lot, you're really good at this stuff!. Anyways, how can we change the code to make the output remove array(10) { , [0]=> and string(12)...ect? Ah man this stuff...

              array(10) {
              [0]=>
              string(12) "Chatham-Kent"
              [1]=>
              string(51) "Observed at: Ridgetown 31 December 2005 1:00 PM EST"
              [2]=>
              string(1) "2"
              [3]=>
              string(1) "C"
              [4]=>
              string(5) "100.4"
              [5]=>
              string(6) "&#8593;"
              [6]=>
              string(3) "100"
              [7]=>
              string(1) "2"
              [8]=>
              string(1) "C"
              [9]=>
              string(12) "WSW 13 km/h "
              }

                Yes... just remove the var_dump($info) line.

                The reason I did that was so you can see how the array is set up. You can do this though:

                <?php
                
                $url = 'http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html';
                $handle = fopen($url, "r");
                $weather = file_get_contents($url);
                fclose($handle);
                
                /**
                 * Clean up the retrieved HTML code
                 *	
                 *  We clean up the source we got here.  Basically, we only want a section
                 *  of the code.  We only need the working weather section.  So we cut out
                 *  the meat, starting at '<div id="citybanneradright" class="right">' and
                 *  ending at '<div id="cityadditional">' which will give us just the info
                 *  about the current conditions.  Exactly what we want!!
                 */
                $weather = substr($weather, strpos($weather, '<div id="citybanneradright" class="right">'), (strpos($weather,'<div id="cityadditional">')-strpos($weather, '<div id="citybanneradright" class="right">')));
                $weather = substr($weather, strpos($weather, '<h1>'), ((strpos($weather, '</dl>')-strpos($weather, '<h1>'))+5));
                
                
                /**
                 * PERL RegEx Pattern to match
                 *	
                 *	The pattern of what the HTML will look like each time that page is hit
                 *	by us (or any other viewer).  We define areas with parenthesis "()"
                 *	and what their values can contain with ranges "[a-zA-Z]".
                 *	Research Regular Expressions if you don't understand.
                 */
                 $pattern = "@<h1>[\s\n]*<a name=\"content\">&nbsp;</a>([\w\s\-.]*)</h1>[\s\n]*<div id=\"city\">[\s\n]*<div id=\"box\">[\s\n]*<div id=\"citycurrent\">[\s\n]*<h2>Currently</h2>[\s\n]*<div id=\"cityobserved\">([\w\-\s\:]*)</div>[\s\n]*<dl>[\s\n]*<dt>Temperature</dt>[\s\n]*<dd>([\d\-.]*) &deg;([F|C]{1})</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Pressure/ Tendency</dt>[\s\n]*<dd>([\d\.\-]*) kPa<span class=\"([\w]*)\" id=\"[\w]*\">[\w&;]*</span></dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Humidity</dt>[\s\n]*<dd>([\d\-.]*) %</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Dewpoint</dt>[\s\n]*<dd>([\d\-]*) &deg;([F|C]{1})</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*<dt>Wind</dt>[\s\n]*<dd>([\w\-\n\/\t\:\s.]*)</dd>[\s\n]*<dd class=\"dd1\"/>[\s\n]*</dl>@m";
                
                preg_match($pattern, $weather, $info);
                array_shift($info);
                
                /**
                 * Define variable names.
                 *
                 *	Each array element will become a variable name.  You can use whatever
                 *	naming scheme you wish, but this was easiest for me to understand.
                 *
                 *	Variable names will be:
                 *		$loc
                 *		$obs
                 *		$temp
                 *		$temp_scale
                 *		etc. . . .
                 */
                $var = array(	'loc',				# Location
                							'obs',				# Observation information
                							'temp',				# Temperature
                							'temp_scale', # Temperature Scale (Celsius, Farenheit)
                							'barom',			# Barometric Pressure
                							'barom_tend', # Barometric Pressure Tendency (rising, falling, steady)
                							'humidity',		# Humidity
                							'dewpt',			# Dew Point
                							'dew_scale',  # Dew Point Scale (Celsius, Farenheit)
                							'wind'				# Wind speed information
                						);				
                
                /**
                 * Extract information from preg_match array into custom variables.
                 *
                 *	Loop through the array $info.  Using the array key as a point of reference, we
                 *	create a variable with the name that corresponds to the key in the array $var.
                 *	From that, we give that new variable the value it is supposed to have.
                 *
                 *	This is an alternative.  You can use $info[0] -> $info[9] to reference these values
                 *	as well.  Either way will work.  It's up to you.
                 */
                foreach($info as $key => $val)
                {
                  $$var[$key] = $val;
                }
                
                // Echo out something about the weather....
                echo 'Currently in '.$loc.' (<em>'.$obs.'</em>) it is <strong>'.$temp.' &deg; '.$temp_scale.'</strong>.<br>';
                echo 'The barometric pressure is '.$barom.' and '.$barom_tend.' with '.$humidity.'% humidity.  ';
                echo 'The dew point is '.$dewpt.' &deg;'.$dew_scale.'.  Winds are '.$wind;
                ?>

                Read my comments, they'll help you out.

                ~Brett

                  Okay, how did you know it would be $dew_scale and not $dewpoint_scale? Also on the webpage http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html, would it be basically the same thing for the text forecast at the bottom of the page? Would it be <b><?echo $forecasttitles[1]?>: </b><?echo $forecasttext[1]?><br>...ect? How would I set this one up?

                    The oddest thing happened with your code... I changed the location, to this http://www.weatheroffice.ec.gc.ca/city/pages/on-143_metric_e.html and it no longer works. Would it be because it has a current observation, and an image (ex. light snow, with a picture of light snow)? How can this code be changed to include this?

                    The errors are as follows:
                    Notice: Undefined variable: loc in C:\Sites\Single25\litohin\webroot\example2.php on line 32

                    Notice: Undefined variable: obs in C:\Sites\Single25\litohin\webroot\example2.php on line 32

                    Notice: Undefined variable: temp in C:\Sites\Single25\litohin\webroot\example2.php on line 32

                    Notice: Undefined variable: temp_scale in C:\Sites\Single25\litohin\webroot\example2.php on line 32
                    ()
                    Temperature: °

                    Notice: Undefined variable: barom in C:\Sites\Single25\litohin\webroot\example2.php on line 33

                    Notice: Undefined variable: barom_tend in C:\Sites\Single25\litohin\webroot\example2.php on line 33

                    Notice: Undefined variable: humidity in C:\Sites\Single25\litohin\webroot\example2.php on line 33
                    Barometric Pressure: -
                    Humidity: % humidity.
                    Notice: Undefined variable: dewpt in C:\Sites\Single25\litohin\webroot\example2.php on line 34

                    Notice: Undefined variable: dew_scale in C:\Sites\Single25\litohin\webroot\example2.php on line 34

                    Notice: Undefined variable: wind in C:\Sites\Single25\litohin\webroot\example2.php on line 34

                    Dew Point: °
                    Winds:

                    <?php
                    $url = 'http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html';
                    $handle = fopen($url, "r");
                    $weather = file_get_contents($url);
                    fclose($handle);

                    $weather = substr($weather, strpos($weather, '<div id="citybanneradright" class="right">'), (strpos($weather,'<div id="cityadditional">')-strpos($weather, '<div id="citybanneradright" class="right">')));
                    $weather = substr($weather, strpos($weather, '<h1>'), ((strpos($weather, '</dl>')-strpos($weather, '<h1>'))+5));

                    $pattern = "@<h1>[\s\n]<a name=\"content\">&nbsp;</a>([\w\s-.])</h1>[\s\n]<div id=\"city\">[\s\n]<div id=\"box\">[\s\n]<div id=\"citycurrent\">[\s\n]<h2>Currently</h2>[\s\n]<div id=\"cityobserved\">([\w-\s:])</div>[\s\n]<dl>[\s\n]<dt>Temperature</dt>[\s\n]<dd>([\d-.]) &deg;([F|C]{1})</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Pressure/ Tendency</dt>[\s\n]<dd>([\d.-]) kPa<span class=\"([\w])\" id=\"[\w]\">[\w&;]</span></dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Humidity</dt>[\s\n]<dd>([\d-.]) %</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Dewpoint</dt>[\s\n]<dd>([\d-]) &deg;([F|C]{1})</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Wind</dt>[\s\n]<dd>([\w-\n\/\t:\s.])</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]*</dl>@m";

                    preg_match($pattern, $weather, $info);
                    array_shift($info);

                    $var = array( 'loc', # Location
                    'obs', # Observation information
                    'temp', # Temperature
                    'temp_scale', # Temperature Scale (Celsius, Farenheit)
                    'barom', # Barometric Pressure
                    'barom_tend', # Barometric Pressure Tendency (rising, falling, steady)
                    'humidity', # Humidity
                    'dewpt', # Dew Point
                    'dew_scale', # Dew Point Scale (Celsius, Farenheit)
                    'wind' # Wind speed information
                    );

                    foreach($info as $key => $val)

                    {
                    $$var[$key] = $val;
                    }
                    echo '<font face="arial" size="1">'.$loc.' (<em>'.$obs.'</em>)<br>Temperature: '.$temp.' &deg; '.$temp_scale.'<br>';
                    echo 'Barometric Pressure: '.$barom.' - '.$barom_tend.'<br> Humidity: '.$humidity.'% humidity. ';
                    echo '<br>Dew Point:'.$dewpt.' &deg;'.$dew_scale.'<br> Winds: '.$wind;
                    ?>

                      I also noticed that if one of the conditions is missing the script will no longer work. Ex. wind-chill is not calculated because there is no wind, wind picks up and wind-chill is now calculated and shown. Now the script no longer works...how can it be changed to work when a variable is missing?

                        I can't seem to make this work...I can't get it to work with the added windchill, can anyone help?

                        <?php
                        $url = 'http://www.weatheroffice.ec.gc.ca/city/pages/on-11_metric_e.html';
                        $handle = fopen($url, "r");
                        $weather = file_get_contents($url);
                        fclose($handle);

                        $weather = substr($weather, strpos($weather, '<div id="citybanneradright" class="right">'), (strpos($weather,'<div id="cityadditional">')-strpos($weather, '<div id="citybanneradright" class="right">')));
                        $weather = substr($weather, strpos($weather, '<h1>'), ((strpos($weather, '</dl>')-strpos($weather, '<h1>'))+5));

                        $pattern = "@<h1>[\s\n]<a name=\"content\">&nbsp;</a>([\w\s-.])</h1>[\s\n]<div id=\"city\">[\s\n]<div id=\"box\">[\s\n]<div id=\"citycurrent\">[\s\n]<h2>Currently</h2>[\s\n]<div id=\"cityobserved\">([\w-\s:])</div>[\s\n]<dl>[\s\n]<dt>Temperature</dt>[\s\n]<dd>([\d-.]) &deg;([F|C]{1})</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Pressure/ Tendency</dt>[\s\n]<dd>([\d.-]) kPa<span class=\"([\w])\" id=\"[\w]\">[\w&;]</span></dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Humidity</dt>[\s\n]<dd>([\d-.]) %</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Windchill[\s\n]<dd>([\d-.]) &deg;([F|C]{1})</</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Dewpoint</dt>[\s\n]<dd>([\d-]) &deg;([F|C]{1})</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]<dt>Wind</dt>[\s\n]<dd>([\w-\n\/\t:\s.])</dd>[\s\n]<dd class=\"dd1\"/>[\s\n]*</dl>@m";

                        preg_match($pattern, $weather, $info);
                        array_shift($info);

                        $var = array( 'loc', # Location
                        'obs', # Observation information
                        'temp', # Temperature
                        'temp_scale', # Temperature Scale (Celsius, Farenheit)
                        'barom', # Barometric Pressure
                        'barom_tend', # Barometric Pressure Tendency (rising, falling, steady)
                        'humidity', # Humidity
                        'windchill', # Wind Chill
                        'dewpt', # Dew Point
                        'dew_scale', # Dew Point Scale (Celsius, Farenheit)
                        'wind' # Wind speed information
                        );

                        foreach($info as $key => $val)

                        {
                        $$var[$key] = $val;
                        }
                        echo '<font face="arial" size="1">'.$loc.' (<em>'.$obs.'</em>)Temperature: '.$temp.' &deg; '.$temp_scale.;
                        echo 'Barometric Pressure: '.$barom.' - '.$barom_tend.' Humidity: '.$humidity.'% humidity. 'Wind Chill: '.$windchill.' &deg; '.$temp_scale.;
                        echo 'Dew Point:'.$dewpt.' &deg;'.$dew_scale.' Winds: '.$wind;
                        ?>

                          I can't test anything right now (I'm home, not at school) but I can offer this advice:

                          1.) It would be 1,000 times easier if they offered an XML version or RSS feed of conditions
                          2.) For each item you want to extract, you have to add it to the array, and also add it to the conditional. If it is not guaranteed to be there (like Windchill, or "foggy" or "hazy") then you need to denote that in the pattern. I will see what I can do about making you an all-inclusive one tomorrow.

                          ~Brett

                            A much easier way to do want you are wanting plus will give you a lot more options wether you just want to build weather stickers or a complete page this you need to visit HamWeather Plus all the data is already been parsed for you and the software is free.

                            He is the weather page I am working on for my site that is powered by this software.

                            http://www.texascampingforum.com/weather/2006.html

                            This is just a test page that I am working on so it will have dead links. It will give you a general idea though.

                              bpat1434 wrote:

                              I can't test anything right now (I'm home, not at school) but I can offer this advice:

                              1.) It would be 1,000 times easier if they offered an XML version or RSS feed of conditions
                              2.) For each item you want to extract, you have to add it to the array, and also add it to the conditional. If it is not guaranteed to be there (like Windchill, or "foggy" or "hazy") then you need to denote that in the pattern. I will see what I can do about making you an all-inclusive one tomorrow.

                              ~Brett

                              Okay, thanks Brett! I'll be waiting! Also the Canadian government doesn’t offer feeds; therefore their servers won't get over loaded!


                              A much easier way to do want you are wanting plus will give you a lot more options wether you just want to build weather stickers or a complete page this you need to visit HamWeather Plus all the data is already been parsed for you and the software is free.

                              He is the weather page I am working on for my site that is powered by this software.

                              http://www.texascampingforum.com/weather/2006.html

                              This is just a test page that I am working on so it will have dead links. It will give you a general idea though.

                              I've got to many codes to go back and buy HamWeather. I've got basically all the American weather data, and now I'm just stuck with the Canadian current conditions, thanks to Rincewind I now can get current Canadian warnings and forecasts!

                                HamWeather is free and fully customizable as well as the numerous different plugins and it contains Canadian feeds that are already parsed for you. The only thing you pay for if you choose is option services. So it would be a better soultion for you in the long run since it is FREE and the support is excellant. Not to mention the feeds you are parse is part of IWIN which is set for temination at the end of Jan. So you will be back to square one. The possiblites you can do with this progam is endless. I can show you numerous examples if you like of what this program will do.

                                  What features do you need to pay for, and what is free?

                                    Everythign is free for personal use, but if you use it commercially you pay for it. It's laid out in their website: HamWeather 3.9 PHP

                                    ~Brett

                                      That is somewhat true. If you want to remove the credits and if you are going to use it to offer data for other sites, I.E. RSS feeds etc. Then it will cost you. Other then that it is entirely free. The only thing you would probably need to buy is the SQL or Flatfile for the citys. That is $4 dollars and once you have that you have all the citys in N. America. You don't have to have it, but without it you only get the major cities. So if you are just using it to provide weather information to the public then it is completely free and all the stuff you can do with it is endless.

                                      The pay features they have are well worth it but you don't have to have it unless you are wanting a really indepth weather page and that is mainly what you are building. You would just need to go surf thier site. They are some really nice guys over there. Lee, Nick and Jeff are the devlopers and will help you with what ever you need. If you are just wanting weather stickers like what is on my portal page.

                                      http://www.texascampingforum.com/forum/portal.php

                                      scroll down to see it. That is just one thing you can do with it. Build a template inside the weather folder and then add a include statement on the page where you want it. Plus all the maps you can include your sites name. It is just an overall great program and the only one like it that you can fully customize to your site. Plus all the free plugins you can add and the excellant support. Just give it a try, I promise you'll like it. If you have any questions or problems you can PM me or I am on the forums over there as well.

                                        I looked at your site, and I wanted to just say first of all it's nice. I would use HamWeather but I don't know the first thing to do when setting it up...and it looks like it would take quite a while.