<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Improve the Weather with PHP	</title>
	<atom:link href="https://mikeindustries.com/blog/archive/2004/08/php-weather/feed" rel="self" type="application/rss+xml" />
	<link>https://mikeindustries.com/blog/archive/2004/08/php-weather</link>
	<description>A running commentary of occasionally interesting things — from Mike Davidson.</description>
	<lastBuildDate>Thu, 26 May 2016 06:34:40 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>
		By: Rob Antonishen		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-582</link>

		<dc:creator><![CDATA[Rob Antonishen]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-582</guid>

					<description><![CDATA[I was flipping through your blog entries and this one caught my eye.  In particular thanks for the pointer to the Astro Sunrise class.

I combined it with some ideas in an &lt;a href=&quot;http://www.phpbuilder.com/columns/moss20031023.php3&quot; rel=&quot;nofollow&quot;&gt;article from Simon Moss over at PHPBuilder&lt;/a&gt; on GIS locating with PHP and GD.

Now my web site displays a cute word map showing my location and the day/night terminator and my sunrise/sunset for today:
&lt;a href=&quot;http://ffaat.pointclark.net/blog/&quot; rel=&quot;nofollow&quot;&gt;&lt;a href=&quot;http://ffaat.pointclark.net/blog/&quot; rel=&quot;nofollow&quot;&gt;http://ffaat.pointclark.net/blog/&lt;/a&gt;&lt;/a&gt;

Couple of things for you:

The class provides function to set the variables, so rather than your code (eg sunstatus-&gt;lat=47) you should just call:
   $sunstatus-&gt;setCoords(47,-122);

(there is error checking in the Set calls).  The same for Timezone.  Also for the date, use the following instead of your three lines:
  $sunstatus-&gt;setDate(date(&#039;Y&#039;),date(&#039;m&#039;),date(&#039;j&#039;));

Lastly, there is a bug in the class (I have emailed the author).  On line 160 $R is used:
    $S = $R - sin($Q) * sin($E);

This needs to be defined just before use, like so:
    $R = $this-&gt;R;
    $S = $R - sin($Q) * sin($E);

Otherwise the Radius corrections are not applied.

Again - Thanks!  Love the writing.]]></description>
			<content:encoded><![CDATA[<p>I was flipping through your blog entries and this one caught my eye.  In particular thanks for the pointer to the Astro Sunrise class.</p>
<p>I combined it with some ideas in an <a href="http://www.phpbuilder.com/columns/moss20031023.php3" rel="nofollow">article from Simon Moss over at PHPBuilder</a> on GIS locating with PHP and GD.</p>
<p>Now my web site displays a cute word map showing my location and the day/night terminator and my sunrise/sunset for today:<br />
<a href="http://ffaat.pointclark.net/blog/" rel="nofollow"></a><a href="http://ffaat.pointclark.net/blog/" rel="nofollow">http://ffaat.pointclark.net/blog/</a></p>
<p>Couple of things for you:</p>
<p>The class provides function to set the variables, so rather than your code (eg sunstatus->lat=47) you should just call:<br />
   $sunstatus->setCoords(47,-122);</p>
<p>(there is error checking in the Set calls).  The same for Timezone.  Also for the date, use the following instead of your three lines:<br />
  $sunstatus->setDate(date(&#8216;Y&#8217;),date(&#8216;m&#8217;),date(&#8216;j&#8217;));</p>
<p>Lastly, there is a bug in the class (I have emailed the author).  On line 160 $R is used:<br />
    $S = $R &#8211; sin($Q) * sin($E);</p>
<p>This needs to be defined just before use, like so:<br />
    $R = $this->R;<br />
    $S = $R &#8211; sin($Q) * sin($E);</p>
<p>Otherwise the Radius corrections are not applied.</p>
<p>Again &#8211; Thanks!  Love the writing.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: CLPettit		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-574</link>

		<dc:creator><![CDATA[CLPettit]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-574</guid>

					<description><![CDATA[You might find this interesting
&lt;a href=&quot;http://cleardarksky.com/csk/&quot; rel=&quot;nofollow&quot;&gt;http://cleardarksky.com/csk/&lt;/a&gt;
It&#039;ll guess/predict your weather/sky condition night or day.]]></description>
			<content:encoded><![CDATA[<p>You might find this interesting<br />
<a href="http://cleardarksky.com/csk/" rel="nofollow">http://cleardarksky.com/csk/</a><br />
It&#8217;ll guess/predict your weather/sky condition night or day.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dominic		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-575</link>

		<dc:creator><![CDATA[dominic]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-575</guid>

					<description><![CDATA[so, has anyone got this working for us europeans? - I&#039;d really like to know... Thanks]]></description>
			<content:encoded><![CDATA[<p>so, has anyone got this working for us europeans? &#8211; I&#8217;d really like to know&#8230; Thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Schmelding		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-576</link>

		<dc:creator><![CDATA[Schmelding]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-576</guid>

					<description><![CDATA[This rawks and works on my internal server, but a lot of folks can&#039;t use it with sites that reside on a shared hosting service provider because they are restricted from using cronjobs. Any other solutions besides using cron and you&#039;ve got this licked!]]></description>
			<content:encoded><![CDATA[<p>This rawks and works on my internal server, but a lot of folks can&#8217;t use it with sites that reside on a shared hosting service provider because they are restricted from using cronjobs. Any other solutions besides using cron and you&#8217;ve got this licked!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ole Hansen		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-577</link>

		<dc:creator><![CDATA[Ole Hansen]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-577</guid>

					<description><![CDATA[&lt;a href=&quot;http://cronjob.de/&quot; rel=&quot;nofollow&quot;&gt;http://cronjob.de/&lt;/a&gt; is one possible solution for people who cannot set up their own cronjobs.

Oh, and the validator for the Email Address field is broken. It rejected my perfectly valid address. Hint: just about anything goes before @. This is an example of a syntactically valid address 
&quot;Jack &amp; Jill + their son&quot;@example.com]]></description>
			<content:encoded><![CDATA[<p><a href="http://cronjob.de/" rel="nofollow">http://cronjob.de/</a> is one possible solution for people who cannot set up their own cronjobs.</p>
<p>Oh, and the validator for the Email Address field is broken. It rejected my perfectly valid address. Hint: just about anything goes before @. This is an example of a syntactically valid address<br />
&#8220;Jack &#038; Jill + their son&#8221;@example.com</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mike Purvis		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-578</link>

		<dc:creator><![CDATA[Mike Purvis]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-578</guid>

					<description><![CDATA[Schmelding: An alternative to cron is to simply check for each visitor if the current information is more than an hour stale. If so, fetch it while generating their pageview.

I avoided having cron call PHP by just using wget, eg:

wget --output-document=/home/me/public_html/weather.rss &#039;http://rssweather.com/rss.php?...&#039;

The single quotes are necessary for the ampersands to get parsed correctly.]]></description>
			<content:encoded><![CDATA[<p>Schmelding: An alternative to cron is to simply check for each visitor if the current information is more than an hour stale. If so, fetch it while generating their pageview.</p>
<p>I avoided having cron call PHP by just using wget, eg:</p>
<p>wget &#8211;output-document=/home/me/public_html/weather.rss &#8216;http://rssweather.com/rss.php?&#8230;&#8217;</p>
<p>The single quotes are necessary for the ampersands to get parsed correctly.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Joshua Kendall		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-579</link>

		<dc:creator><![CDATA[Joshua Kendall]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-579</guid>

					<description><![CDATA[I just downloaded this and then uploaded it and it gives me this error:

&lt;blockquote&gt;&quot;,$CONTENTS); $ARRAY2 = explode(&quot;&lt;/blockquote&gt;

Any ideas why? I am using &quot;http://www.nws.noaa.gov/data/current_obs/KTHV.rss&quot; which is my local airport.]]></description>
			<content:encoded><![CDATA[<p>I just downloaded this and then uploaded it and it gives me this error:</p>
<blockquote><p>&#8220;,$CONTENTS); $ARRAY2 = explode(&#8220;</p></blockquote>
<p>Any ideas why? I am using &#8220;http://www.nws.noaa.gov/data/current_obs/KTHV.rss&#8221; which is my local airport.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Joshua Kendall		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-580</link>

		<dc:creator><![CDATA[Joshua Kendall]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-580</guid>

					<description><![CDATA[Just tried it again without changing anything and it gave me this:

&lt;blockquote&gt;#!/usr/local/bin/php -q &quot;,$CONTENTS); $ARRAY2 = explode(&quot;&lt;/blockquote&gt;]]></description>
			<content:encoded><![CDATA[<p>Just tried it again without changing anything and it gave me this:</p>
<blockquote><p>#!/usr/local/bin/php -q &#8220;,$CONTENTS); $ARRAY2 = explode(&#8220;</p></blockquote>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: userdude		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-581</link>

		<dc:creator><![CDATA[userdude]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-581</guid>

					<description><![CDATA[Ok, very nice; once I got a clue what was going on, it worked!

Just one problem: The sunset/sunrise seems to be off by an hour at night. It was reading out 18:13 when in fact it should have said 19:13 for where I&#039;m at lon/lat? I don&#039;t know; looking at the script, it seems to run off the date/timestamp, but I haven&#039;t quite gotten it figured out yet what I can do. Is this an issue with the daylight savings in my area?

Very nice, though! :D]]></description>
			<content:encoded><![CDATA[<p>Ok, very nice; once I got a clue what was going on, it worked!</p>
<p>Just one problem: The sunset/sunrise seems to be off by an hour at night. It was reading out 18:13 when in fact it should have said 19:13 for where I&#8217;m at lon/lat? I don&#8217;t know; looking at the script, it seems to run off the date/timestamp, but I haven&#8217;t quite gotten it figured out yet what I can do. Is this an issue with the daylight savings in my area?</p>
<p>Very nice, though! :D</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: userdude		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-586</link>

		<dc:creator><![CDATA[userdude]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-586</guid>

					<description><![CDATA[You can pickup the information from the accuweather.com website:

&lt;a href=&quot;http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR&#124;UK&#124;UK001&#124;LONDON&#124;&amp;metric=1&quot; rel=&quot;nofollow&quot;&gt;http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR&#124;UK&#124;UK001&#124;LONDON&#124;&amp;metric=1&lt;/a&gt;

This is a link to the London, England XML file; this information is updated once every two minutes, I believe. You can pull this and transform it into an array and then traverse the array to get the information that you&#039;re looking for.

To get the code for your area, visit:

&lt;a href=&quot;http://wwwa.accuweather.com/index-world.asp&quot; rel=&quot;nofollow&quot;&gt;http://wwwa.accuweather.com/index-world.asp&lt;/a&gt;

and plug in your town/city, and then use the zipcode from the query string, replacing &#039;location=EUR&#124;UK&#124;UK001&#124;LONDON&#124;&#039; in the link above with &#039;location=NEW_LOCATION&#124;INFORMATION&#124;QUERY&#124;TEXT&#039;.

Hope that Helps!
jd]]></description>
			<content:encoded><![CDATA[<p>You can pickup the information from the accuweather.com website:</p>
<p><a href="http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR|UK|UK001|LONDON|&#038;metric=1" rel="nofollow"></a><a href="http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR" rel="nofollow ugc">http://forecastfox.accuweather.com/adcbin/forecastfox/weather_data.asp?location=EUR</a>|UK|UK001|LONDON|&#038;metric=1</p>
<p>This is a link to the London, England XML file; this information is updated once every two minutes, I believe. You can pull this and transform it into an array and then traverse the array to get the information that you&#8217;re looking for.</p>
<p>To get the code for your area, visit:</p>
<p><a href="http://wwwa.accuweather.com/index-world.asp" rel="nofollow">http://wwwa.accuweather.com/index-world.asp</a></p>
<p>and plug in your town/city, and then use the zipcode from the query string, replacing &#8216;location=EUR|UK|UK001|LONDON|&#8217; in the link above with &#8216;location=NEW_LOCATION|INFORMATION|QUERY|TEXT&#8217;.</p>
<p>Hope that Helps!<br />
jd</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: lyteforce.ca		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-590</link>

		<dc:creator><![CDATA[lyteforce.ca]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-590</guid>

					<description><![CDATA[&lt;strong&gt;The Lazyman&#039;s Window&lt;/strong&gt;

While I was attempting to calm myself down from the denial I received from my past ISSN application, I ended up coming across Mike Davidson and his blog.  And well, wouldn&#039;t you know, but Mike has setup a PHP script which allows one to display a fairl...
]]></description>
			<content:encoded><![CDATA[<p><strong>The Lazyman&#8217;s Window</strong></p>
<p>While I was attempting to calm myself down from the denial I received from my past ISSN application, I ended up coming across Mike Davidson and his blog.  And well, wouldn&#8217;t you know, but Mike has setup a PHP script which allows one to display a fairl&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JD on MX		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-589</link>

		<dc:creator><![CDATA[JD on MX]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-589</guid>

					<description><![CDATA[&lt;strong&gt;Davidson&#039;s weather&lt;/strong&gt;

Davidson&#039;s weather: Mike Davidson writes of how he had to interpret and improve the raw info given in a weather web service. On one level it&#039;s a story about a particular operation, but on another level it&#039;s a story about...]]></description>
			<content:encoded><![CDATA[<p><strong>Davidson&#8217;s weather</strong></p>
<p>Davidson&#8217;s weather: Mike Davidson writes of how he had to interpret and improve the raw info given in a weather web service. On one level it&#8217;s a story about a particular operation, but on another level it&#8217;s a story about&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jD		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-588</link>

		<dc:creator><![CDATA[jD]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-588</guid>

					<description><![CDATA[Hi Mike,
Do you think you could share the .fla for the weather function?
I understand the information you have presented. But it is
beyond me to pull it in to the flash file.

thanks,
jD]]></description>
			<content:encoded><![CDATA[<p>Hi Mike,<br />
Do you think you could share the .fla for the weather function?<br />
I understand the information you have presented. But it is<br />
beyond me to pull it in to the flash file.</p>
<p>thanks,<br />
jD</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: MultiZ		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-587</link>

		<dc:creator><![CDATA[MultiZ]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-587</guid>

					<description><![CDATA[Thanks for the post.

Is there an example/demo for the weather module?

I&#039;ll try it out anyway, probably.

Thanks again.]]></description>
			<content:encoded><![CDATA[<p>Thanks for the post.</p>
<p>Is there an example/demo for the weather module?</p>
<p>I&#8217;ll try it out anyway, probably.</p>
<p>Thanks again.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: usedude		</title>
		<link>https://mikeindustries.com/blog/archive/2004/08/php-weather#comment-584</link>

		<dc:creator><![CDATA[usedude]]></dc:creator>
		<pubDate>Tue, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-584</guid>

					<description><![CDATA[Hey, that&#039;s great! Thanks for the tip. I was looking for something like that, but didn&#039;t come across an answer. Much thanks.

If you&#039;d like to see an implementation of the weather and sunrise class, I&#039;ve used it here:

&lt;a href=&quot;http://web2.unt.edu/riskman/index.php?section=index&quot; rel=&quot;nofollow&quot;&gt;http://web2.unt.edu/riskman/index.php?section=index&lt;/a&gt;

I modified the weather data to use the XML feed instead, since I found it had much more information contained within it than the RSS feed. I started putting together a small file to author the string data and save it to a flat file, but I haven&#039;t been able to finish it with so many other projects out there. My mockup is located here:

&lt;a href=&quot;http://www.mulkeymason.com/communication/setweather.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mulkeymason.com/communication/setweather.html&lt;/a&gt;

It&#039;s about half-finished, though, and doesn&#039;t work at all in Internet Explorer.

Thanks again.]]></description>
			<content:encoded><![CDATA[<p>Hey, that&#8217;s great! Thanks for the tip. I was looking for something like that, but didn&#8217;t come across an answer. Much thanks.</p>
<p>If you&#8217;d like to see an implementation of the weather and sunrise class, I&#8217;ve used it here:</p>
<p><a href="http://web2.unt.edu/riskman/index.php?section=index" rel="nofollow">http://web2.unt.edu/riskman/index.php?section=index</a></p>
<p>I modified the weather data to use the XML feed instead, since I found it had much more information contained within it than the RSS feed. I started putting together a small file to author the string data and save it to a flat file, but I haven&#8217;t been able to finish it with so many other projects out there. My mockup is located here:</p>
<p><a href="http://www.mulkeymason.com/communication/setweather.html" rel="nofollow">http://www.mulkeymason.com/communication/setweather.html</a></p>
<p>It&#8217;s about half-finished, though, and doesn&#8217;t work at all in Internet Explorer.</p>
<p>Thanks again.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
