Thread: Re: Using PHPWeather question
Brought to you by:
iridium
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: 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: 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: 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: Daisyhead <je...@da...> - 2004-02-18 04:19:06
|
I don't think I'm explaining myself very clear on what I want my weather to look like. I want a simple list, without the whole paragraph text. Something that look like this: Temp: Feels like: Conditions: Wind: Humidity: Dewpoint: Pressure: Visibility: And this is the code I"m trying to tweak to get the information to be listed as above: <?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"; ?> Is there any way to list out the output instead of having it in paragraph format? Thank you, Jenni ----- Original Message ----- From: "Max Hammond" <ma...@fl...> To: "Daisyhead" <je...@da...>; <php...@li...> Sent: Tuesday, February 10, 2004 2:28 AM Subject: RE: Using PHPWeather question > > 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 > > > > ------------------------------------------------------- > 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: Ondrej J. <ne...@po...> - 2004-03-26 16:05:36
|
On Tue, 17 Feb 2004, Daisyhead wrote: > I don't think I'm explaining myself very clear on what I want my weather to > look like. I want a simple list, without the whole paragraph text. Something > that look like this: > Temp: > Feels like: > Conditions: > Wind: > Humidity: > Dewpoint: > Pressure: > Visibility: If you want a simple key/value output similar to Nepto.SK [1], I can post an appropriate code here, however it is nothing special. [1] http://nepto.sk/about-me/news.php > Is there any way to list out the output instead of having it in paragraph > format? I do not understand this. Nepto -- _/| Ondrej Jombik - ne...@ph... - http://nepto.sk - ICQ #122428216 <_ \ Platon SDG - open source software development - http://platon.sk `\| This message was written with Pine, the fastest IMAP mail client '` |
From: Jenni <je...@da...> - 2004-03-26 19:25:59
|
> If you want a simple key/value output similar to Nepto.SK [1], I can > post an appropriate code here, however it is nothing special. > > [1] http://nepto.sk/about-me/news.php What you have in your current weather box is EXACTLY what I was looking for. I wanted something in "list" form instead of the big old paragraph output that comes by default. Do you have the code available so it will look like what is in your current weather box? Thank you SOOO much! Jenni |
From: Ondrej J. <ne...@po...> - 2004-03-27 00:54:07
Attachments:
nepto.sk-weather-plugin.tgz
|
On Fri, 26 Mar 2004, Jenni wrote: > > If you want a simple key/value output similar to Nepto.SK [1], I can > > post an appropriate code here, however it is nothing special. [1] > > http://nepto.sk/about-me/news.php > What you have in your current weather box is EXACTLY what I was > looking for. I wanted something in "list" form instead of the big old > paragraph output that comes by default. Well, I understand. Actually, to create paragraph with reasonable sentences is much more sophisticated and difficult work, than simple list of key/values. At least in my native Slovak language. :-) > Do you have the code available so it will look like what is in your > current weather box? The code is in the attachement. It will certainly not work for you at the first time. It has to be used rather as an inspiration. It is plugin for my personal Nepto.SK website, what has currently over 1500 files. I will not post all of these files. Of course, some well-known phpWeather files are included. Also some library files may be required (at least Platon.php). It is part of our Platon SDG [1] basic PHP framework [2] and can be found in our CVS repository accesible via CVSweb [3]. Let me know if you need more information or there will be some problems. [1] http://platon.sk/ [2] http://platon.sk/cvs/cvs.php/phpPlatonLib/Platon/ [3] http://platon.sk/cvs/cvs.php/ -- _/| Ondrej Jombik - ne...@ph... - http://nepto.sk - ICQ #122428216 <_ \ Platon SDG - open source software development - http://platon.sk `\| Ako sa do hory vola, tak sa zhori traktor! (c) 1999 Rattkin/MFF '` |
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 > > |