Thank you for sharing !

regards

D. R
ichardy
----- Original Message ----- From: "Brian Humes" <bhu...@johnson-rauhoff.com>
To: "Witango Talk" <witango-talk@witango.com>
Sent: Wednesday, June 03, 2009 3:50 PM
Subject: Witango-Talk: A couple of custom tags


Hi all,

I developed a couple of custom tags for some projects I was working on
and I thought they might be useful to someone else out there. I've
attached a .zip file containing all of the files you'll need. PLEASE
feel free to edit/correct/whatever. If you do, perhaps you would post
it back to the community and let us know what enhancements you made.

The tags are <@weather> and <@months>.

<@weather> is a simple way to access weather information supplied by
NOAA. It requires two parameters: airport and attribute. Here's an
example:

<@weather airport="ORD" attribute="temp_f">

This will return the current temperature in degrees Fahrenheit for
Chicago O'Hare airport. A limitation of the tag is that only airports
are supported (no zip codes, etc.). You can use either 3 or 4 letter
airport identifiers. If you use a 3 letter identifier, the app will
insert a "K" in front of it. Unfortunately, only US airports are
supported.

Valid values for the attribute argument (and a sample output) are:

location (Chicago/Ohare, IL)
station_id (KORD)
latitude (41.98)
longitude (-87.9)
observation_time (Last Updated on Jun 3 2009, 4:51 am CDT)
observation_time_rfc822 (Wed,  3 Jun 2009 04:51:00 -0500)
weather (Mostly Cloudy)
temperature_string (49.0 F (9.4 C))
temp_f (49.0)
temp_c (9.4)
relative_humidity (83)
wind_string (Northeast at 13.8 MPH (12 KT))
wind_dir (Northeast)
wind_degrees (30)
wind_mph (13.8)
wind_kt (12)
pressure_string (1020.2 mb)
pressure_mb (1020.2)
pressure_in (30.12)
dewpoint_string (44.1 F (6.7 C))
dewpoint_f (44.1)
dewpoint_c (6.7)
windchill_string (44 F (7 C))
windchill_f (44)
windchill_c (7)
visibility_mi (10.00)

There are some others available, but these are the important ones. To
view the others, visit:

http://www.weather.gov/xml/current_obs/KORD.xml

and view the source.

The other tag is <@months>. This works exactly like <@days>, but with
months. An example:

<@months date="<@currentdate>" months="-3" format="datetime:%m/%d/%Y">

Given today's date of June 3, 2009, this example would return
"3/3/2009". Another example:

<@months date="2/3/2009" months="-4" format="datetime:%m/%d/%Y">

This would return "10/3/2008".

Please note that these tags were written for a very controlled
intranet environment. I have NOT written any error checking into the
apps (invalid airport codes, invalid weather attributes, invalid
dates, etc.) so please be aware.

Hope these are useful to someone. Let me know if you have questions or
problems.


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


--------------------------------------------------------------------------------




Brian Humes
Director, Interactive
JohnsonRauhoff
269-428-9257 (direct)
269-428-3377 (main)
269-428-3312 (fax)
www.johnson-rauhoff.com
bhu...@johnson-rauhoff.com





________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to