google weather api problems
<p>I am having problems with google weather api I have been using this script <a href="http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/" rel="nofollow">http://komunitasweb.com/2009/09/showing-the-weather-with-php-and-google-weather-api/</a> for sometime now but earlier I got this error:</p>

<blockquote>
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]:
  //www.google.com/ig/api?weather=bermuda:2:
  parser error : Opening and ending tag
  mismatch: meta line 1 and HEAD in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]:
  302 Moved
  in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]: ^ in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]:
  //www.google.com/ig/api?weather=bermuda:6:
  parser error : Opening and ending tag
  mismatch: HEAD line 1 and HTML in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]:
   in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]: ^ in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]:
  //www.google.com/ig/api?weather=bermuda:7:
  parser error : Premature end of data
  in tag HTML line 1 in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]: in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Warning: simplexml_load_file()
  [function.simplexml-load-file]: ^ in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 3</p>
  
  <p>Fatal error: Call to a member function
  xpath() on a non-object in
  /home/webmx04/public_html/weather/widgetlive1.php
  on line 4</p>
</blockquote>

<p>Can anyone help me thank you</p>

<p>My code:</p>

<pre><code>&lt;?
$xml = simplexml_load_file('http://www.google.com/ig/api?weather=bermuda');
$information = $xml-&gt;xpath("/xml_api_reply/weather/forecast_information");
$current = $xml-&gt;xpath("/xml_api_reply/weather/current_conditions");
$forecast_list = $xml-&gt;xpath("/xml_api_reply/weather/forecast_conditions");
?&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Google Weather API&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="widget-wrapper"&gt;&lt;!-- start widget-wrapper--&gt;
 &lt;div class="weather"&gt;&lt;!-- start weather--&gt; 

         &lt;h2&gt;&lt;a href="/section/weather" title="More on Weather" target="_top"&gt;Current Weather&lt;/a&gt;&lt;/h2&gt;  
           &lt;a href="/section/weather" target="_top"&gt;&lt;img src="&lt;?= 'http://www.rgbdahosting.com' . $current[0]-&gt;icon['data']?&gt;" alt="More on Weather"?&gt;&lt;/a&gt;
            &lt;span class="condition"&gt;
          &lt;a href="/section/weather" title="More on Weather" target="_top"&gt;&lt;H4&gt;&lt;?= $current[0]-&gt;temp_f['data'] ?&gt;&amp;deg;F&lt;/H4&gt;

           &lt;p&gt;&lt;?= $current[0]-&gt;condition['data'] ?&gt;&lt;/p&gt;&lt;/a&gt;
            &lt;/span&gt;
        &lt;/div&gt;&lt;!-- end weather--&gt;

&lt;/div&gt;  &lt;!-- end widget-wrapper--&gt;
&lt;/body&gt;
</code></pre>

<p>     </p>
