phpweather-devel Mailing List for PHP Weather (Page 4)
Brought to you by:
iridium
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
(52) |
Mar
(79) |
Apr
(9) |
May
(28) |
Jun
(17) |
Jul
(25) |
Aug
(48) |
Sep
(18) |
Oct
(6) |
Nov
|
Dec
(8) |
2003 |
Jan
(26) |
Feb
(10) |
Mar
(2) |
Apr
(21) |
May
(23) |
Jun
(15) |
Jul
(15) |
Aug
(8) |
Sep
(16) |
Oct
(3) |
Nov
(4) |
Dec
|
2004 |
Jan
(35) |
Feb
(35) |
Mar
(9) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(4) |
Feb
(6) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
2006 |
Jan
|
Feb
(5) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Daisyhead <je...@da...> - 2004-02-11 03:32:19
|
Okay, so what if I just want a simple list of certain things? This is the code I have, but the only things pulling info are the temp, wind and humidity fields. Can I do something like below and still have it pull all the info I want? <?php require('/home/xxx/public_html/weather/phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); $foo = $weather->decode_metar(); $temp_c = $foo['temperature']['temp_c']; $temp_f = $foo['temperature']['temp_f']; $miles_per_hour = $foo['wind']['miles_per_hour']; $dew_point = $foo['dew-point']['dew_point']; $visibility_less_than = $foo['visibility']['visibility_less_than']; $feelslike = $foo['feelslike']['feelslike']; $weather = $foo['weather']['weather']; $rel_humidity = $foo['rel_humidity']['rel_humidity']; $altimeter = $foo['altimeter']['altimeter']; echo "Temp: $temp_f ° Fahrenheit<br>"; echo "Feels like: $feelslike<br>"; echo "Conditions: $weather<br>"; echo "Wind: $miles_per_hour MPH<br>"; echo "Humidity: $rel_humidity %<br>"; echo "Dewpoint: $dew_point<br>"; echo "Pressure: $altimeter<br>"; echo "Visibility: $visibility_less_than"; ?> Thanks, Jenni ----- Original Message ----- From: "Max Hammond" <ma...@fl...> To: "Daisyhead" <je...@da...>; <php...@li...> Sent: Tuesday, February 10, 2004 2:26 AM Subject: RE: Using PHPWeather question > > > > Is > > there any way to use a "shortcut" and call in all the variables? > > sure... this is the way that PHPweather was really designed to be used. > > <?php > > // first of all, set up the decoder > require('phpweather.php'); > $weather = new phpweather(); > $weather->set_icao("KOMA"); > > // next, the text parsing > require('output/pw_text_en.php'); > $text = new pw_text_en($weather); > echo $text->print_pretty(); > > echo '<br />'; > > // now, images > require('output/pw_images.php'); > $icons = new pw_images($weather); > echo '<img src="' . $icons->get_sky_image() . > '" height="50" width="80" border="1" alt="Current weather in ' . > $weather->get_location() . '" /> ' . > '<img src="' . $icons->get_winddir_image() . > '" height="40" width="40" border="1" alt="Current wind in ' . > $weather->get_location() . '" /> ' . > '<img src="' . $icons->get_temp_image() .' />'; > > > ?> > > Cheers, > > Max > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > > |
From: Max H. <ma...@fl...> - 2004-02-10 08:28:48
|
errr bad HTML on my part. <?php // first of all, set up the decoder require('phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); // next, the text parsing require('output/pw_text_en.php'); $text = new pw_text_en($weather); echo $text->print_pretty(); echo '<br />'; // now, images require('output/pw_images.php'); $icons = new pw_images($weather); echo '<img src="' . $icons->get_sky_image() . '" height="50" width="80" border="1" alt="Current weather in ' . $weather->get_location() . '" /> ' . '<img src="' . $icons->get_winddir_image() . '" height="40" width="40" border="1" alt="Current wind in ' . $weather->get_location() . '" /> ' . '<img src="' . $icons->get_temp_image() .'" />'; ?> is better :) max |
From: Max H. <ma...@fl...> - 2004-02-10 08:27:00
|
> Is > there any way to use a "shortcut" and call in all the variables? sure... this is the way that PHPweather was really designed to be used. <?php // first of all, set up the decoder require('phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); // next, the text parsing require('output/pw_text_en.php'); $text = new pw_text_en($weather); echo $text->print_pretty(); echo '<br />'; // now, images require('output/pw_images.php'); $icons = new pw_images($weather); echo '<img src="' . $icons->get_sky_image() . '" height="50" width="80" border="1" alt="Current weather in ' . $weather->get_location() . '" /> ' . '<img src="' . $icons->get_winddir_image() . '" height="40" width="40" border="1" alt="Current wind in ' . $weather->get_location() . '" /> ' . '<img src="' . $icons->get_temp_image() .' />'; ?> Cheers, Max |
From: Etienne T. <et...@om...> - 2004-02-10 03:34:48
|
On Mon, 2004-02-09 at 18:50, Daisyhead wrote: > > The 2.x series have better (but still far from perfect) documentation, > > which you'll find in the tarball/zipfile. > > Thank you Martin. I guess it's just because I'm not all that familiar with > PHP yet. I am looking at the documentation that came with my v2.x download > and I've managed to figure out how to call in the temp and wind speed, but > am having problems with things like visibility and cloud cover, etc. Is > there any way to use a "shortcut" and call in all the variables? > If you want a "shortcut" you should use the methods in output/pw_text.php. It has methods like print_pretty(), print_pretty_visibility(), print_pretty_clouds(). It will even be in the language you set. Look at the index.php file, it has all the necessary steps. For your needs, I would put in print_pretty_visibility() and not print_pretty(), which is what the main page of phpweather uses. Etienne > Thanks, > Jenni > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > |
From: Daisyhead <je...@da...> - 2004-02-10 00:19:41
|
> The 2.x series have better (but still far from perfect) documentation, > which you'll find in the tarball/zipfile. Thank you Martin. I guess it's just because I'm not all that familiar with PHP yet. I am looking at the documentation that came with my v2.x download and I've managed to figure out how to call in the temp and wind speed, but am having problems with things like visibility and cloud cover, etc. Is there any way to use a "shortcut" and call in all the variables? Thanks, Jenni |
From: Max H. <ma...@fl...> - 2004-02-09 09:01:30
|
> If you're annoyed about having your password spread across several > files, then the easiest solution is to make your defaults.php file > reference the password as a variable: > > /* db_password */ > $this->properties['db_password'] = $GLOBALS['password']; > > and then make sure that $password is in the global scope. I wouldn't do that unless either i) you are the only user on your server, or ii) PHP is in safe mode. Otherwise, some other user could include() your file, and retrieve your password. Cheers, Max |
From: Max H. <ma...@fl...> - 2004-02-09 08:25:58
|
> If you're annoyed about having your password spread across several > files, then the easiest solution is to make your defaults.php file > reference the password as a variable: > > /* db_password */ > $this->properties['db_password'] = $GLOBALS['password']; > > and then make sure that $password is in the global scope. I wouldn't do that unless either i) you are the only user on your server, or ii) PHP is in safe mode. Otherwise, some other user could include() your file, and retrieve your password. Cheers, Max |
From: Phil P. <phi...@sw...> - 2004-02-09 01:01:49
|
> Yes, it calls mysql_connect or mysql_pconnect in the connect method in > file db/pw_db_mysql.php. Yup! Saw that. >>However in the process of generating my page, I already initiate a >>connection to the database. >> >>Is there any *really simple* way I can pass these details to >>phpWeather for it to use? Assuming, of course, that phpWeather won't >>blithely go and close the pre-existing connection once it's done >>with it. > > > If you're worried about having two open links to MySQL at the same > time, then there's no problem, the PHP manual says: > > If a second call is made to mysql_connect() with the same arguments, > no new link will be established, but instead, the link identifier of > the already opened link will be returned. That's the one! mmm, odd - I'm fairly sure it's the same params (no other db/user/pass is valid) and yet I'm seeing that 1 page refresh shows Connections Counter+2 under MySQL CC. There's only my 'insert a pageview' thingy which assumes an open connection (ie it's opened by the main page script) and then there's my call to phpWeather - nothing else talks to the database. I guess I need to do more hunting. > If you're annoyed about having your password spread across several > files, then the easiest solution is to make your defaults.php file > reference the password as a variable: > > /* db_password */ > $this->properties['db_password'] = $GLOBALS['password']; oooh! Nice suggestion, this is MUCH cleaner - thanks. > and then make sure that $password is in the global scope. > > And finally, there is a disconnect method in all the database > backends, but it isn't used at the moment, and I don't think that will > change, it's just there for completeness. OK good. Thanks, Phil P |
From: Martin G. <gim...@gi...> - 2004-02-09 00:57:09
|
Phil Pierotti <phi...@sw...> writes: Hi Phil, it's nice with all your feedback! > From what I can tell, once you configure phpWeather to talk to MySQL, > it will make its own connection to the database. Yes, it calls mysql_connect or mysql_pconnect in the connect method in file db/pw_db_mysql.php. > However in the process of generating my page, I already initiate a > connection to the database. > > Is there any *really simple* way I can pass these details to > phpWeather for it to use? Assuming, of course, that phpWeather won't > blithely go and close the pre-existing connection once it's done > with it. If you're worried about having two open links to MySQL at the same time, then there's no problem, the PHP manual says: If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. If you're annoyed about having your password spread across several files, then the easiest solution is to make your defaults.php file reference the password as a variable: /* db_password */ $this->properties['db_password'] = $GLOBALS['password']; and then make sure that $password is in the global scope. And finally, there is a disconnect method in all the database backends, but it isn't used at the moment, and I don't think that will change, it's just there for completeness. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2004-02-09 00:46:43
|
"Jenni" <je...@da...> writes: > I have installed and configured PHPWeather, but am having problems > actually getting it to work on my blog. > > [...] > > I cannot see where I have a filed named "phpweather.inc" or > "locale_en.inc" The code you're trying to use was written for the obsolete 1.x series of PHP Weather. Unless you have a really old installation of PHP, or some other strange demands, then you should use the new 2.x series, specifically version 2.2.1: http://sf.net/project/showfiles.php?group_id=23245&package_id=69338&release_id=214708 > Can anyone clue me in as to what I did wrong? The documentation > isn't very user friendly for us newbies. ;-) The 2.x series have better (but still far from perfect) documentation, which you'll find in the tarball/zipfile. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2004-02-08 23:12:53
|
"Jenni" <je...@da...> writes: > I have installed and configured PHPWeather, but am having problems > actually getting it to work on my blog. > > [...] > > I cannot see where I have a filed named "phpweather.inc" or > "locale_en.inc" The code you're trying to use was written for the obsolete 1.x series of PHP Weather. Unless you have a really old installation of PHP, or some other strange demands, then you should use the new 2.x series, specifically version 2.2.1: http://sf.net/project/showfiles.php?group_id=23245&package_id=69338&release_id=214708 > Can anyone clue me in as to what I did wrong? The documentation > isn't very user friendly for us newbies. ;-) The 2.x series have better (but still far from perfect) documentation, which you'll find in the tarball/zipfile. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Martin G. <gim...@gi...> - 2004-02-08 23:11:52
|
Phil Pierotti <phi...@sw...> writes: Hi Phil, it's nice with all your feedback! > From what I can tell, once you configure phpWeather to talk to MySQL, > it will make its own connection to the database. Yes, it calls mysql_connect or mysql_pconnect in the connect method in file db/pw_db_mysql.php. > However in the process of generating my page, I already initiate a > connection to the database. > > Is there any *really simple* way I can pass these details to > phpWeather for it to use? Assuming, of course, that phpWeather won't > blithely go and close the pre-existing connection once it's done > with it. If you're worried about having two open links to MySQL at the same time, then there's no problem, the PHP manual says: If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. If you're annoyed about having your password spread across several files, then the easiest solution is to make your defaults.php file reference the password as a variable: /* db_password */ $this->properties['db_password'] = $GLOBALS['password']; and then make sure that $password is in the global scope. And finally, there is a disconnect method in all the database backends, but it isn't used at the moment, and I don't think that will change, it's just there for completeness. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. |
From: Max H. <ma...@fl...> - 2004-02-08 23:07:23
|
Hi, > From what I can tell, once you configure phpWeather to talk to MySQL, > it will make its own connection to the database. yes > However in the process of generating my page, I already initiate a > connection to the database. > > Is there any *really simple* way I can pass these details to phpWeather > for it to use? Assuming, of course, that phpWeather won't blithely go > and close the pre-existing connection once it's done with it. If you're using pconnect() - permenent connections to the database, it doesn't matter - it'll just use an existing connection if one is open. Cheers, Max |
From: Max H. <ma...@fl...> - 2004-02-08 21:34:49
|
Hi Jenni, You've closed the PHP ?> twice... > echo "Temp: $temp_f ° Fahrenheit<br>"; > ?> > echo "Wind: $miles_per_hour MPH"; > ?> > get rid of the first one of those ?>'s Cheers, Max -- Actions are the seeds of Fate. Deeds grow into Destiny. *A.L. Linall, Jr. |
From: Daisyhead <je...@da...> - 2004-02-08 20:56:19
|
Max, Could I ask one more question? I'm trying to add other tags and my current code looks like this: <?php require('/home/xxx/public_html/weather/phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); $foo = $weather->decode_metar(); $temp_c = $foo['temperature']['temp_c']; $temp_f = $foo['temperature']['temp_f']; $miles_per_hour = $foo['wind']['miles_per_hour']; echo "Temp: $temp_f ° Fahrenheit<br>"; ?> echo "Wind: $miles_per_hour MPH"; ?> But I cannot get the wind speed to show up. Any idea what I'm doing wrong? I thought you could just plug in the other tags you want and Presto! Thanks, Jenni |
From: Daisyhead <je...@da...> - 2004-02-08 20:05:46
|
> Incidentally, we're all busy people doing other things, so don't be > suprised if a reply takes a day or two. I totally understand Max. I apologize if I came off as being pushy and/or rude. I was just frustrated by not being able to get it running. I wish there was a forum or something so we could get a little more help. Although I suppose the product was written for people with more knowledge of PHP and SQL than myself. Thanks again! -Jenni |
From: Max H. <ma...@fl...> - 2004-02-08 19:20:54
|
Jenni, almost there. <?php require('phpweather.php'); $weather = new phpweather(); $weather->set_icao("KOMA"); $foo = $weather->decode_metar(); $temp_c = $foo['temperature']['temp_c']; $temp_f = $foo['temperature']['temp_f']; echo "<p>The temperature is $temp_c degrees Celsius ($temp_f degrees Fahrenheit).</p>"; ?> If this script isn't in the same place as the phpweather install, you'll need to modify the first line accordingly. Incidentally, we're all busy people doing other things, so don't be suprised if a reply takes a day or two. Cheers, Max > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of > Daisyhead > Sent: 08 February 2004 18:23 > To: php...@li... > Subject: Re: Using PHPWeather question > > > A couple of clarifications. I'm using v2.21 of PHPWeather and cannot find > what code I need to place in my blog to pull the weather info in. > > This is my second request for h*lp. Can someone please respond? > > Thanks, > Jenni > > > ----- Original Message ----- > From: "Jenni" <je...@da...> > To: <php...@li...> > Sent: Saturday, February 07, 2004 11:55 AM > Subject: Using PHPWeather question > > > > I have installed and configured PHPWeather, but am having problems > actually > > getting it to work on my blog. I am fairly new to PHP and > MySQL, although > > I've been able to teach myself enough to figure most things out. But for > > some reason I cannot figure out how to call the weather information into > my > > blog. I tried using: > > > > <?php > > include('phpweather.inc'); > > include('locale_en.inc'); > > $metar = get_metar('KOMA'); > > $data = process_metar($metar); > > $temp_c = $data['temp_c']; > > $temp_f = $data['temp_f']; > > echo "<p>The temperature is $temp_c degrees Celsius ($temp_f degrees > > Fahrenheit).</p>"; > > ?> > > > > I cannot see where I have a filed named "phpweather.inc" or > "locale_en.inc" > > Can anyone clue me in as to what I did wrong? The documentation > isn't very > > user friendly for us newbies. ;-) > > > > Thanks, > > Jenni > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > |
From: Daisyhead <je...@da...> - 2004-02-08 18:23:36
|
A couple of clarifications. I'm using v2.21 of PHPWeather and cannot find what code I need to place in my blog to pull the weather info in. This is my second request for h*lp. Can someone please respond? Thanks, Jenni ----- Original Message ----- From: "Jenni" <je...@da...> To: <php...@li...> Sent: Saturday, February 07, 2004 11:55 AM Subject: Using PHPWeather question > I have installed and configured PHPWeather, but am having problems actually > getting it to work on my blog. I am fairly new to PHP and MySQL, although > I've been able to teach myself enough to figure most things out. But for > some reason I cannot figure out how to call the weather information into my > blog. I tried using: > > <?php > include('phpweather.inc'); > include('locale_en.inc'); > $metar = get_metar('KOMA'); > $data = process_metar($metar); > $temp_c = $data['temp_c']; > $temp_f = $data['temp_f']; > echo "<p>The temperature is $temp_c degrees Celsius ($temp_f degrees > Fahrenheit).</p>"; > ?> > > I cannot see where I have a filed named "phpweather.inc" or "locale_en.inc" > Can anyone clue me in as to what I did wrong? The documentation isn't very > user friendly for us newbies. ;-) > > Thanks, > Jenni |
From: Phil P. <phi...@sw...> - 2004-02-08 04:17:11
|
From what I can tell, once you configure phpWeather to talk to MySQL, it will make its own connection to the database. I've added data from phpWeather to my webpage, and it's all working fine. However in the process of generating my page, I already initiate a connection to the database. Is there any *really simple* way I can pass these details to phpWeather for it to use? Assuming, of course, that phpWeather won't blithely go and close the pre-existing connection once it's done with it. Thanks, Phil P |
From: Jenni <je...@da...> - 2004-02-07 17:55:56
|
I have installed and configured PHPWeather, but am having problems actually getting it to work on my blog. I am fairly new to PHP and MySQL, although I've been able to teach myself enough to figure most things out. But for some reason I cannot figure out how to call the weather information into my blog. I tried using: <?php include('phpweather.inc'); include('locale_en.inc'); $metar = get_metar('KOMA'); $data = process_metar($metar); $temp_c = $data['temp_c']; $temp_f = $data['temp_f']; echo "<p>The temperature is $temp_c degrees Celsius ($temp_f degrees Fahrenheit).</p>"; ?> I cannot see where I have a filed named "phpweather.inc" or "locale_en.inc" Can anyone clue me in as to what I did wrong? The documentation isn't very user friendly for us newbies. ;-) Thanks, Jenni -- "Nowadays every girl with a henna tattoo and a spice rack thinks she's a sister to the dark ones." |
From: Etienne T. <et...@om...> - 2004-02-07 15:42:31
|
which version are you using? the cvs and current (2.2.1) versions should not have this problem. The problem was in the 2.2.0 version. Etienne On Sat, 2004-02-07 at 01:08, Phil Pierotti wrote: > I kept receiving warnings when inserting or updating METARS, complaining > that both update_metar() and insert_metar() were missing their 4th > parameter $time. > > I looked to where hey are called from , in data_retrieval.php and saw > > /* side effect */ > // $metar_time = $date[0].$date[1].$date[2].$date[3].$date[4]."00"; > > and shortly after calls to both insert_metar() and update_metar() *but > with only 3 parameters* as opposed to 4 as per the function definitions. > > So I uncommented the $metar_time assignment, and appended > ,$metar_time > as the 4th parameter to the insert/update metar calls. > > Much Better. > > Enjoy, > Phil P > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > |
From: Phil P. <phi...@sw...> - 2004-02-07 06:08:33
|
I kept receiving warnings when inserting or updating METARS, complaining that both update_metar() and insert_metar() were missing their 4th parameter $time. I looked to where hey are called from , in data_retrieval.php and saw /* side effect */ // $metar_time = $date[0].$date[1].$date[2].$date[3].$date[4]."00"; and shortly after calls to both insert_metar() and update_metar() *but with only 3 parameters* as opposed to 4 as per the function definitions. So I uncommented the $metar_time assignment, and appended ,$metar_time as the 4th parameter to the insert/update metar calls. Much Better. Enjoy, Phil P |
From: Etienne T. <et...@om...> - 2004-02-06 17:00:53
|
Hi, On Sun, 2004-01-25 at 17:16, aguevara wrote: > I started using phpweather on my site, the installation went very > well; I am not using a db at this point in time. > > > > The reason I am writing is because my data is not being refreshed and > I would like to understand how to make sure it is displaying the > latest and greatest data. I have two(2) questions, > I'm afraid I don't understand fully your problem. The data is not the latest, as in a few hours old? Unfortunately the data from noaa is sometimes a bit late. Especially in Canada, sometimes the reports are 2-3 hours old. > > > (1) I have isolated the phpweather into its own file (i.e. > temp.php) and am using an <include> tag. Will this refresh OK ? > There should be no problem with that. Again, by refresh what do you mean? Having the page refresh automatically every x minutes? > (2) I am only displaying the icons/images on my main page, I also > have a link which takes you to another page (i.e. temp2.php) where I > allow the user to select the country, city, etc. which is the default > behavior. How can I make this second page always display the latest > and greatest and not cached ? If you are using the same methods as in the main page (index.php) you should get the latest data. Again it might not be the most recent data, but the most recent AVAILABLE from noaa. If you want to see if the data displayed in the web page is the same that is available, point your browser to http://weather.noaa.gov/pub/data/observations/metar/stations/$icao.TXT where $icao (upper case) is the icao code of the station. Also, make sure you are using the latest version of phpweather (2.2.1). cheers, Etienne > > > Please advise. > > > > Have a great day, > Angelo A. Guevara > > an...@ca... > > > > |
From: SourceForge.net <no...@so...> - 2004-02-05 15:02:23
|
Feature Requests item #891080, was opened at 2004-02-05 15:02 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377955&aid=891080&group_id=23245 Category: Localisation Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nick Crossland (ncrossland) Assigned to: Nobody/Anonymous (nobody) Summary: UK language file - meter/metre Initial Comment: I have done a UK English language file, since we spell metric units differently: metres kilometres rather than the American meters kilometers Don't know where to submit the file to though. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377955&aid=891080&group_id=23245 |
From: Phil P. <phi...@sw...> - 2004-02-04 01:27:31
|
Here are some of my random thoughts on enabling sunrise/sunset calculations in PHP Weather. Current entries in pw_stations = 5130 Entries from NOAA (http://weather.noaa.gov/data/nsd_cccc.txt) = 6486 - Read the NOAA datafile and update pw_stations - additional fields for LAT and LONG, STATE, ALTITUDE - add records for new STATIONS (1356 new entries) Goal: finding current 'offset from UTC including Daylight Savings if required' for a station Source: the Public Domain TimeZone Database (http://www.twinsun.com/tz/tz-link.htm) As well as being a database of all the timezones including their DST usage zone.tab lists (amongst other things) ISO 3166 2-character country code TimeZone used So, we can match a CC from our stations list to an entry from zone.tab (for speed put the TimeZone into a field in pw_stations) This tells us which timezone to use. In theory, getting the total offset from GMT should then be as simple as $realTZ = getenv('TZ'); putenv ("TZ=$timeZone"); $GMT_offset = date('O'); putenv("TZ=$realTZ"); .... Now we have ICAO Name ISO CC Country Name State Latitude Longitude current GMT offset including DST Grab PHP example code from http://www.zend.com/codex.php?id=135&single=1 I ran a check with co-ords for Sydney, given a hard-coded $DST=1 this code produces data correct to within 10 minutes ie good enough for our uses - tweak code - not calculate DST , just needs $GMT_offset_including_DST - accept co-ordinates as either DMS or decimal (ie auto-convert DMS to decimal) - input params ( GMT DATE, lat, long , local GMT offset including DST ) - returns list($sunriseTimeStamp, $sunsetTimeStamp) - hack code in pw_images.php to identify night_or_day via these calculations Thoughts/comments/suggestions? Phil P Phil Pierotti wrote: > A little trolling around on the web found me THIS interesting chunk of > PHP code: > > http://www.zend.com/codex.php?id=135&single=1 > > Specificallly, an implementation of calculating sunrise and set from > LAT+LONG+GMT Offset > > Enjoy, > Phil P > > > Martin Geisler wrote: > >> Phil Pierotti <phi...@sw...> writes: >> >> >>> Realistically, for this to be complete and flexible, each ICAO will >>> need the following information: >>> - TimeZone specified as offset from GMT >>> - uses Daylight Savings? >>> - DST start date >>> - DST end date >>> - latitude & longitude >>> >>> The sunrise and sunset times can be calculated from the information >>> from NOAA http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html >> >> >> >> Thanks a lot for that link --- we've made an attempt to implement this >> kind of functionality before, but when I searched the net I only found >> some messy algorithms that I didn't have much luck with, see >> >> http://makeashorterlink.com/?T162215A2 >> >> The information on the above page looks much clearer, and it should be >> easy to port the JavaScript code to PHP --- those two languages are >> very much alike. >> >> >>> Lat and Long can be had for ICAOs from >>> http://weather.noaa.gov/tg/site.shtml directly -> >>> http://weather.noaa.gov/data/nsd_cccc.txt >> >> >> >> Thanks again --- I've found those datafiles before, but the >> information is still not part of PHP Weather. Given the latitude and >> longitude it should be possible to calculate an approximate timezone. >> >> And with that timezone we should be able to give a local time for the >> reports, but I guess it will still be off by +/- 1 hours depending on >> daylight saving time, so I don't know how good that idea is. >> >> It's just that the real solution: attaching detailed information about >> the daylight saving time to each station, sounds like a difficult >> task. But then again, there must be some tables with this information >> somewhere on every system, so perhaps it's doable? >> >> >> In any case --- I'm having my exams right now! The first one will be >> on Wednesday, so I wont start playing with this stuff now, but if >> someone else feels like it, then by all mean do! I can add people to >> the project as developers if they believe they need CVS access. >> > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > PHPWeather-devel mailing list > PHP...@li... > https://lists.sourceforge.net/lists/listinfo/phpweather-devel > > |