summaryrefslogtreecommitdiff
path: root/calendar/backends/weather
diff options
context:
space:
mode:
authorDavid Trowbridge <trowbrds@cs.colorado.edu>2005-01-07 11:32:00 +0000
committerRodrigo Moya <rodrigo@src.gnome.org>2005-01-07 11:32:00 +0000
commit6210d3d5f186fd60a1fdcc5f22584ca23b49388b (patch)
treeb00893c5a9e8e521eb359d479c7b349c5bff33c5 /calendar/backends/weather
parent237be65373cea282ce606e7812c6f805dae82ee2 (diff)
downloadevolution-data-server-6210d3d5f186fd60a1fdcc5f22584ca23b49388b.tar.gz
Import weather calendar backend
2005-01-06 David Trowbridge <trowbrds@cs.colorado.edu> * backends/weather/*: Import weather calendar backend
Diffstat (limited to 'calendar/backends/weather')
-rw-r--r--calendar/backends/weather/Locations.xml.in736
-rw-r--r--calendar/backends/weather/Makefile.am42
-rw-r--r--calendar/backends/weather/e-cal-backend-weather-factory.c114
-rw-r--r--calendar/backends/weather/e-cal-backend-weather-factory.h35
-rw-r--r--calendar/backends/weather/e-cal-backend-weather.c888
-rw-r--r--calendar/backends/weather/e-cal-backend-weather.h54
-rw-r--r--calendar/backends/weather/e-weather-source-ccf.c444
-rw-r--r--calendar/backends/weather/e-weather-source-ccf.h59
-rw-r--r--calendar/backends/weather/e-weather-source.c73
-rw-r--r--calendar/backends/weather/e-weather-source.h103
10 files changed, 2548 insertions, 0 deletions
diff --git a/calendar/backends/weather/Locations.xml.in b/calendar/backends/weather/Locations.xml.in
new file mode 100644
index 000000000..3f4743bdf
--- /dev/null
+++ b/calendar/backends/weather/Locations.xml.in
@@ -0,0 +1,736 @@
+<?xml version="1.0"?>
+<evolutionweather format="1.0">
+ <region name="Atlantic Ocean">
+ <territory name="Puerto Rico">
+ <location type="ccf" code="SJU" url="http://www.crh.noaa.gov/data/JSJ/CCFSJU">San Juan</location>
+ </territory>
+ <territory name="Virgin Islands">
+ <location type="ccf" code="STT" url="http://www.crh.noaa.gov/data/JSJ/CCFSJU">Charlotte Amalie</location>
+ </territory>
+ </region>
+ <region name="North America">
+ <country name="United States">
+ <state name="Alabama">
+ <location type="ccf" code="BHM" url="http://www.crh.noaa.gov/data/BMX/CCFBMX">Birmingham</location>
+ <location type="ccf" code="DHN" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Dothan</location>
+ <location type="ccf" code="GZH" url="http://www.crh.noaa.gov/data/MOB/CCFMOB">Evergreen</location>
+ <location type="ccf" code="HSV" url="http://www.crh.noaa.gov/data/HUN/CCFHUN">Huntsville</location>
+ <location type="ccf" code="MOB" url="http://www.crh.noaa.gov/data/MOB/CCFMOB">Mobile</location>
+ <location type="ccf" code="MGM" url="http://www.crh.noaa.gov/data/BMX/CCFBMX">Montgomery</location>
+ <location type="ccf" code="BFL" url="http://www.crh.noaa.gov/data/HUN/CCFHUN">Muscle Shoals</location>
+ </state>
+ <state name="Alaska">
+ <location type="ccf" code="ANC" url="http://www.crh.noaa.gov/data/AFC/CCFAER">Anchorage</location>
+ <location type="ccf" code="FAI" url="http://www.crh.noaa.gov/data/AFG/CCFAFG">Fairbanks</location>
+ <location type="ccf" code="JNU" url="http://www.crh.noaa.gov/data/AJK/CCFAJK">Juneau</location>
+ <location type="ccf" code="KTN" url="http://www.crh.noaa.gov/data/AJK/CCFAJK">Ketchikan</location>
+ <location type="ccf" code="OME" url="http://www.crh.noaa.gov/data/AFG/CCFAFG">Nome</location>
+ <location type="ccf" code="SIT" url="http://www.crh.noaa.gov/data/AJK/CCFAJK">Sitka</location>
+ <location type="ccf" code="YAK" url="http://www.crh.noaa.gov/data/AJK/CCFAJK">Yakutat</location>
+ </state>
+ <state name="Arizona">
+ <location type="ccf" code="FLG" url="http://www.crh.noaa.gov/data/FGZ/CCFFGZ">Flagstaff</location>
+ <location type="ccf" code="HRO" url="http://www.crh.noaa.gov/data/LZK/CCFLZK">Harrison</location>
+ <location type="ccf" code="HOT" url="http://www.crh.noaa.gov/data/LZK/CCFLZK">Hot Springs</location>
+ <location type="ccf" code="IGM" url="http://www.crh.noaa.gov/data/VEF/CCFVEF">Kingman</location>
+ <location type="ccf" code="LIT" url="http://www.crh.noaa.gov/data/LZK/CCFLZK">Little Rock</location>
+ <location type="ccf" code="PGA" url="http://www.crh.noaa.gov/data/FGZ/CCFFGZ">Page</location>
+ <location type="ccf" code="PHX" url="http://www.crh.noaa.gov/data/PSR/CCFPSR">Phoenix</location>
+ <location type="ccf" code="PBF" url="http://www.crh.noaa.gov/data/LZK/CCFLZK">Pine Bluff</location>
+ <location type="ccf" code="PRC" url="http://www.crh.noaa.gov/data/FGZ/CCFFGZ">Prescott</location>
+ <location type="ccf" code="TUS" url="http://www.crh.noaa.gov/data/TWC/CCFTWC">Tucson</location>
+ <location type="ccf" code="INW" url="http://www.crh.noaa.gov/data/FGZ/CCFFGZ">Winslow</location>
+ <location type="ccf" code="YUM" url="http://www.crh.noaa.gov/data/PSR/CCFPSR">Yuma</location>
+ </state>
+ <state name="Arkansas">
+ <location type="ccf" code="FYV" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Fayetteville</location>
+ <location type="ccf" code="FSM" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Fort Smith</location>
+ <location type="ccf" code="JBR" url="http://www.crh.noaa.gov/data/MEG/CCFMEG">Jonesboro</location>
+ <location type="ccf" code="TXK" url="http://www.crh.noaa.gov/data/SHV/CCFSHV">Texarkana</location>
+ </state>
+ <state name="California">
+ <location type="ccf" code="ACV" url="http://www.crh.noaa.gov/data/EKA/CCFEKA">Arcata</location>
+ <location type="ccf" code="BFL" url="http://www.crh.noaa.gov/data/HNX/CCFHNX">Bakersfield</location>
+ <location type="ccf" code="CIH" url="http://www.crh.noaa.gov/data/VEF/CCFVEF">Bishop</location>
+ <location type="ccf" code="BLU" url="http://www.crh.noaa.gov/data/STO/CCFSTO">Blue Canyon</location>
+ <location type="ccf" code="SLE" url="http://www.crh.noaa.gov/data/PQR/CCFPQR">Blythe</location>
+ <location type="ccf" code="CEC" url="http://www.crh.noaa.gov/data/EKA/CCFEKA">Crescent City</location>
+ <location type="ccf" code="DAG" url="http://www.crh.noaa.gov/data/VEF/CCFVEF">Daggett</location>
+ <location type="ccf" code="FAT" url="http://www.crh.noaa.gov/data/HNX/CCFHNX">Fresno</location>
+ <location type="ccf" code="IPL" url="http://www.crh.noaa.gov/data/PSR/CCFPSR">Imperial</location>
+ <location type="ccf" code="TVL" url="http://www.crh.noaa.gov/data/REV/CCFREV">Lake Tahoe</location>
+ <location type="ccf" code="LVK" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">Livermore</location>
+ <location type="ccf" code="MMH" url="http://www.crh.noaa.gov/data/REV/CCFREV">Mammoth Lakes</location>
+ <location type="ccf" code="MRY" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">Monterey</location>
+ <location type="ccf" code="RBL" url="http://www.crh.noaa.gov/data/STO/CCFSTO">Red Bluff</location>
+ <location type="ccf" code="SAC" url="http://www.crh.noaa.gov/data/STO/CCFSTO">Sacramento</location>
+ <location type="ccf" code="SAN" url="http://www.crh.noaa.gov/data/SGX/CCFSGX">San Diego</location>
+ <location type="ccf" code="SFO" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">San Francisco</location>
+ <location type="ccf" code="SJC" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">San Jose</location>
+ <location type="ccf" code="SJC" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">Santa Clara</location>
+ <location type="ccf" code="STS" url="http://www.crh.noaa.gov/data/MTR/CCFMTR">Santa Rosa</location>
+ <location type="ccf" code="UKI" url="http://www.crh.noaa.gov/data/EKA/CCFEKA">Ukiah</location>
+ </state>
+ <state name="Colorado">
+ <location type="ccf" code="ALS" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Alamosa</location>
+ <location type="ccf" code="DEN" url="http://www.crh.noaa.gov/data/BOU/CCFBOU">Boulder</location>
+ <location type="ccf" code="COS" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Colorado Springs</location>
+ <location type="ccf" code="DEN" url="http://www.crh.noaa.gov/data/BOU/CCFBOU">Denver</location>
+ <location type="ccf" code="DRO" url="http://www.crh.noaa.gov/data/GJT/CCFGJT">Durango</location>
+ <location type="ccf" code="ASE" url="http://www.crh.noaa.gov/data/GJT/CCFGJT">Eagle</location>
+ <location type="ccf" code="GJT" url="http://www.crh.noaa.gov/data/GJT/CCFGJT">Grand Junction</location>
+ <location type="ccf" code="LHX" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">La Junta</location>
+ <location type="ccf" code="LAA" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Lamar</location>
+ <location type="ccf" code="LXV" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Leadville</location>
+ <location type="ccf" code="MTJ" url="http://www.crh.noaa.gov/data/GJT/CCFGJT">Montrose</location>
+ <location type="ccf" code="PUB" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Pueblo</location>
+ <location type="ccf" code="TAD" url="http://www.crh.noaa.gov/data/PUB/CCFPUB">Trinidad</location>
+ </state>
+ <state name="Connecticut">
+ <location type="ccf" code="BDR" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Bridgeport</location>
+ <location type="ccf" code="DXR" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Danbury</location>
+ <location type="ccf" code="GON" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Groton</location>
+ <location type="ccf" code="MMK" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Meriden</location>
+ <location type="ccf" code="HVN" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">New Haven</location>
+ <location type="ccf" code="BDL" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Windsor Locks</location>
+ <location type="ccf" code="IJD" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Willimantic</location>
+ </state>
+ <state name="Delaware">
+ <location type="ccf" code="DOV" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Dover</location>
+ <location type="ccf" code="GED" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Georgetown</location>
+ <location type="ccf" code="ILG" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Wilmington</location>
+ </state>
+ <state name="Florida">
+ <location type="ccf" code="BKV" url="http://www.crh.noaa.gov/data/TBW/CCFTBW">Brooksville</location>
+ <location type="ccf" code="CTY" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Cross City</location>
+ <location type="ccf" code="DAB" url="http://www.crh.noaa.gov/data/MLB/CCFMLB">Daytona Beach</location>
+ <location type="ccf" code="FLL" url="http://www.crh.noaa.gov/data/MFL/CCFMFL">Fort Lauderdale</location>
+ <location type="ccf" code="FMY" url="http://www.crh.noaa.gov/data/TBW/CCFTBW">Fort Myers</location>
+ <location type="ccf" code="GNV" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Gainesville</location>
+ <location type="ccf" code="JAX" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Jacksonville</location>
+ <location type="ccf" code="EYW" url="http://www.crh.noaa.gov/data/EYW/CCFEYW">Key West</location>
+ <location type="ccf" code="MTH" url="http://www.crh.noaa.gov/data/EYW/CCFEYW">Marathon Key</location>
+ <location type="ccf" code="MLB" url="http://www.crh.noaa.gov/data/MLB/CCFMLB">Melbourne</location>
+ <location type="ccf" code="MIA" url="http://www.crh.noaa.gov/data/MFL/CCFMFL">Miami</location>
+ <location type="ccf" code="APF" url="http://www.crh.noaa.gov/data/MFL/CCFMFL">Naples</location>
+ <location type="ccf" code="OCF" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Ocala</location>
+ <location type="ccf" code="MCO" url="http://www.crh.noaa.gov/data/MLB/CCFMLB">Orlando</location>
+ <location type="ccf" code="PFN" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Panama City</location>
+ <location type="ccf" code="PNS" url="http://www.crh.noaa.gov/data/MOB/CCFMOB">Pensacola</location>
+ <location type="ccf" code="SGJ" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Saint Augustine</location>
+ <location type="ccf" code="SRQ" url="http://www.crh.noaa.gov/data/TBW/CCFTBW">Sarasota</location>
+ <location type="ccf" code="TLH" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Talahassee</location>
+ <location type="ccf" code="TPA" url="http://www.crh.noaa.gov/data/TBW/CCFTBW">Tampa</location>
+ <location type="ccf" code="VRB" url="http://www.crh.noaa.gov/data/MLB/CCFMLB">Vero Beach</location>
+ <location type="ccf" code="PBI" url="http://www.crh.noaa.gov/data/MFL/CCFMFL">West Palm Beach</location>
+ <location type="ccf" code="GIF" url="http://www.crh.noaa.gov/data/TBW/CCFTBW">Winter Haven</location>
+ </state>
+ <state name="Georgia">
+ <location type="ccf" code="ABY" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Albany</location>
+ <location type="ccf" code="AMG" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Alma</location>
+ <location type="ccf" code="AHN" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Athens</location>
+ <location type="ccf" code="ATL" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Atlanta</location>
+ <location type="ccf" code="AGS" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">Augusta</location>
+ <location type="ccf" code="SSI" url="http://www.crh.noaa.gov/data/JAX/CCFJAX">Brunswick</location>
+ <location type="ccf" code="CSG" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Columbus</location>
+ <location type="ccf" code="GLV" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Gainesville</location>
+ <location type="ccf" code="MCN" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Macon</location>
+ <location type="ccf" code="RMG" url="http://www.crh.noaa.gov/data/FFC/CCFFFC">Rome</location>
+ <location type="ccf" code="VLD" url="http://www.crh.noaa.gov/data/TAE/CCFTAE">Valdosta</location>
+ </state>
+ <state name="Hawaii">
+ <location type="ccf" code="HNL" url="http://www.crh.noaa.gov/data/HFO/CCFHFO">Honolulu</location>
+ </state>
+ <state name="Idaho">
+ <location type="ccf" code="BOI" url="http://www.crh.noaa.gov/data/BOI/CCFBOI">Boise</location>
+ <location type="ccf" code="PIH" url="http://www.crh.noaa.gov/data/PIH/CCFPIH">Pocatello</location>
+ <location type="ccf" code="MYL" url="http://www.crh.noaa.gov/data/BOI/CCFBOI">McCall</location>
+ <location type="ccf" code="TWF" url="http://www.crh.noaa.gov/data/BOI/CCFBOI">Twin Falls</location>
+ </state>
+ <state name="Illinois">
+ <location type="ccf" code="MDH" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Carbondale</location>
+ <location type="ccf" code="CMI" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Champaign</location>
+ <location type="ccf" code="ORD" url="http://www.crh.noaa.gov/data/LOT/CCFLOT">Chicago</location>
+ <location type="ccf" code="DEC" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Decatur</location>
+ <location type="ccf" code="LWV" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Lawrenceville</location>
+ <location type="ccf" code="MTO" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Mattoon</location>
+ <location type="ccf" code="MLI" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Moline</location>
+ <location type="ccf" code="MVN" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Mount Vernon</location>
+ <location type="ccf" code="PIA" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Peoria</location>
+ <location type="ccf" code="MLI" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Quad Cities</location>
+ <location type="ccf" code="UIN" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Quincy</location>
+ <location type="ccf" code="RFD" url="http://www.crh.noaa.gov/data/LOT/CCFLOT">Rockford</location>
+ <location type="ccf" code="SLO" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Salem</location>
+ <location type="ccf" code="SPI" url="http://www.crh.noaa.gov/data/ILX/CCFILX">Springfield</location>
+ </state>
+ <state name="Indiana">
+ <location type="ccf" code="ANQ" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Angola</location>
+ <location type="ccf" code="BMG" url="http://www.crh.noaa.gov/data/IND/CCFIND">Bloomington</location>
+ <location type="ccf" code="CCY" url="http://www.crh.noaa.gov/data/ARX/CCFARX">Charles City</location>
+ <location type="ccf" code="BAK" url="http://www.crh.noaa.gov/data/IND/CCFIND">Columbus</location>
+ <location type="ccf" code="EVV" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Evansville</location>
+ <location type="ccf" code="FWA" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Fort Wayne</location>
+ <location type="ccf" code="IND" url="http://www.crh.noaa.gov/data/IND/CCFIND">Indianapolis</location>
+ <location type="ccf" code="OKK" url="http://www.crh.noaa.gov/data/IND/CCFIND">Kokomo</location>
+ <location type="ccf" code="LAF" url="http://www.crh.noaa.gov/data/IND/CCFIND">Lafayette</location>
+ <location type="ccf" code="MGC" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Michigan City</location>
+ <location type="ccf" code="MIE" url="http://www.crh.noaa.gov/data/IND/CCFIND">Muncie</location>
+ <location type="ccf" code="RCR" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Rochester</location>
+ <location type="ccf" code="SBN" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">South Bend</location>
+ <location type="ccf" code="HUF" url="http://www.crh.noaa.gov/data/IND/CCFIND">Terre Haute</location>
+ <location type="ccf" code="OEA" url="http://www.crh.noaa.gov/data/IND/CCFIND">Vincennes</location>
+ </state>
+ <state name="Iowa">
+ <location type="ccf" code="AMW" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Ames</location>
+ <location type="ccf" code="BRL" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Burlington</location>
+ <location type="ccf" code="CID" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Cedar Rapids</location>
+ <location type="ccf" code="DSM" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Des Moines</location>
+ <location type="ccf" code="EST" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Estherville</location>
+ <location type="ccf" code="FOD" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Fort Dodge</location>
+ <location type="ccf" code="IOW" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Iowa City</location>
+ <location type="ccf" code="LWD" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Lamoni</location>
+ <location type="ccf" code="MIW" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Marshalltown</location>
+ <location type="ccf" code="MCW" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Mason City</location>
+ <location type="ccf" code="OTM" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Ottumwa</location>
+ <location type="ccf" code="DVN" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Quad Cities</location>
+ <location type="ccf" code="SUX" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Sioux City</location>
+ <location type="ccf" code="SPW" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Spencer</location>
+ <location type="ccf" code="ALO" url="http://www.crh.noaa.gov/data/DMX/CCFDMX">Waterloo</location>
+ </state>
+ <state name="Kansas">
+ <location type="ccf" code="WLD" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Arkansas City</location>
+ <location type="ccf" code="CNU" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Chanute</location>
+ <location type="ccf" code="CFV" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Coffeyville</location>
+ <location type="ccf" code="CBK" url="http://www.crh.noaa.gov/data/GLD/CCFGLD">Colby</location>
+ <location type="ccf" code="CNK" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Concordia</location>
+ <location type="ccf" code="DDC" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Dodge City</location>
+ <location type="ccf" code="EQA" url="http://www.crh.noaa.gov/data/ICT/CCFICT">El Dorado</location>
+ <location type="ccf" code="EHA" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Elkhart</location>
+ <location type="ccf" code="EMP" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Emporia</location>
+ <location type="ccf" code="GCK" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Garden City</location>
+ <location type="ccf" code="K68" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Garnett</location>
+ <location type="ccf" code="GLD" url="http://www.crh.noaa.gov/data/GLD/CCFGLD">Goodland</location>
+ <location type="ccf" code="HYS" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Hays</location>
+ <location type="ccf" code="K87" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Hiawatha</location>
+ <location type="ccf" code="HLC" url="http://www.crh.noaa.gov/data/GLD/CCFGLD">Hill City</location>
+ <location type="ccf" code="HUT" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Hutchinson</location>
+ <location type="ccf" code="K88" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Iola</location>
+ <location type="ccf" code="LWC" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Lawrence</location>
+ <location type="ccf" code="LBL" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Liberal</location>
+ <location type="ccf" code="MHK" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Manhattan</location>
+ <location type="ccf" code="MPR" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Mc Pherson</location>
+ <location type="ccf" code="P28" url="http://www.crh.noaa.gov/data/DDC/CCFDDC">Medicine Lodge</location>
+ <location type="ccf" code="EWK" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Newton</location>
+ <location type="ccf" code="OJC" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Olathe</location>
+ <location type="ccf" code="PTS" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">Pittsburg</location>
+ <location type="ccf" code="RSL" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Russel</location>
+ <location type="ccf" code="SLN" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Salina</location>
+ <location type="ccf" code="TOP" url="http://www.crh.noaa.gov/data/TOP/CCFTOP">Topeka</location>
+ <location type="ccf" code="OCT" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Wichita</location>
+ <location type="ccf" code="WLD" url="http://www.crh.noaa.gov/data/ICT/CCFICT">Winfield</location>
+ </state>
+ <state name="Kentucky">
+ <location type="ccf" code="BWG" url="http://www.crh.noaa.gov/data/LMK/CCFLMK">Bowling Green</location>
+ <location type="ccf" code="CVG" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Covington</location>
+ <location type="ccf" code="FGX" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Flemingsburg</location>
+ <location type="ccf" code="HOP" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Fort Campbell</location>
+ <location type="ccf" code="FFT" url="http://www.crh.noaa.gov/data/LMK/CCFLMK">Frankfort</location>
+ <location type="ccf" code="EHR" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Henderson</location>
+ <location type="ccf" code="JKL" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Jackson</location>
+ <location type="ccf" code="LEX" url="http://www.crh.noaa.gov/data/LMK/CCFLMK">Lexington</location>
+ <location type="ccf" code="LOZ" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">London</location>
+ <location type="ccf" code="SDF" url="http://www.crh.noaa.gov/data/LMK/CCFLMK">Louisville</location>
+ <location type="ccf" code="1A6" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Middlesboro</location>
+ <location type="ccf" code="IOB" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Mount Sterling</location>
+ <location type="ccf" code="PAH" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Paducah</location>
+ <location type="ccf" code="K22" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Prestonsburg</location>
+ <location type="ccf" code="SME" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Somerset</location>
+ </state>
+ <state name="Louisiana">
+ <location type="ccf" code="AEX" url="http://www.crh.noaa.gov/data/LCH/CCFLCH">Alexandria</location>
+ <location type="ccf" code="BTR" url="http://www.crh.noaa.gov/data/LIX/CCFLIX">Baton Rouge</location>
+ <location type="ccf" code="CFT" url="http://www.crh.noaa.gov/data/LCH/CCFLCH">Lafayette</location>
+ <location type="ccf" code="LCH" url="http://www.crh.noaa.gov/data/LCH/CCFLCH">Lake Charles</location>
+ <location type="ccf" code="MLU" url="http://www.crh.noaa.gov/data/SHV/CCFSHV">Monroe</location>
+ <location type="ccf" code="MSY" url="http://www.crh.noaa.gov/data/LIX/CCFLIX">New Orleans</location>
+ <location type="ccf" code="SHV" url="http://www.crh.noaa.gov/data/SHV/CCFSHV">Shreveport</location>
+ </state>
+ <state name="Maine">
+ <location type="ccf" code="GMR" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Abbot</location>
+ <location type="ccf" code="AUG" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Augusta</location>
+ <location type="ccf" code="BGR" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Bangor</location>
+ <location type="ccf" code="BHB" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Bar Harbor</location>
+ <location type="ccf" code="NHZ" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Brunswick</location>
+ <location type="ccf" code="CAR" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Caribou</location>
+ <location type="ccf" code="40B" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Clayton</location>
+ <location type="ccf" code="CON" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Concord</location>
+ <location type="ccf" code="FVE" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Frenchville</location>
+ <location type="ccf" code="IZG" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Fryeburg</location>
+ <location type="ccf" code="HUL" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Houlton</location>
+ <location type="ccf" code="60B" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Jackman</location>
+ <location type="ccf" code="LEW" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Lewiston</location>
+ <location type="ccf" code="MLT" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Millinocket</location>
+ <location type="ccf" code="PWM" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Portland</location>
+ <location type="ccf" code="PQI" url="http://www.crh.noaa.gov/data/CAR/CCFCAR">Presque Isle</location>
+ <location type="ccf" code="8B0" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Rangeley</location>
+ <location type="ccf" code="RKD" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Rockland</location>
+ <location type="ccf" code="SFM" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Sanford</location>
+ <location type="ccf" code="WVL" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Waterville</location>
+ <location type="ccf" code="IWI" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Wiscasset</location>
+ </state>
+ <state name="Maryland">
+ <location type="ccf" code="BWI" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Baltimore</location>
+ <location type="ccf" code="HGR" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Hagerstown</location>
+ <location type="ccf" code="OXB" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Ocean City</location>
+ <location type="ccf" code="NHK" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Patuxent River</location>
+ </state>
+ <state name="Massachusetts">
+ <location type="ccf" code="BOS" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Boston</location>
+ <location type="ccf" code="CEF" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Chicopee Falls</location>
+ <location type="ccf" code="LWM" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Lawrence</location>
+ <location type="ccf" code="ACK" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Nantucket</location>
+ <location type="ccf" code="ORE" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Orange</location>
+ <location type="ccf" code="PSF" url="http://www.crh.noaa.gov/data/ALY/CCFALY">Pittsfield</location>
+ <location type="ccf" code="TAN" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Taunton</location>
+ <location type="ccf" code="ORH" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Worcester</location>
+ </state>
+ <state name="Michigan">
+ <location type="ccf" code="ADG" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Adrian</location>
+ <location type="ccf" code="APN" url="http://www.crh.noaa.gov/data/APX/CCFAPX">Alpena</location>
+ <location type="ccf" code="BEH" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Benton Harbor</location>
+ <location type="ccf" code="DTW" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Detroit</location>
+ <location type="ccf" code="FNT" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Flint</location>
+ <location type="ccf" code="GRR" url="http://www.crh.noaa.gov/data/GRR/CCFGRR">Grand Rapids</location>
+ <location type="ccf" code="P58" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Harbor Beach</location>
+ <location type="ccf" code="JYM" url="http://www.crh.noaa.gov/data/IWX/CCFIWX">Hillsdale</location>
+ <location type="ccf" code="LAN" url="http://www.crh.noaa.gov/data/GRR/CCFGRR">Lansing</location>
+ <location type="ccf" code="MKG" url="http://www.crh.noaa.gov/data/GRR/CCFGRR">Muskegon</location>
+ <location type="ccf" code="ADG" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Petersburg</location>
+ <location type="ccf" code="MBS" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Saginaw</location>
+ <location type="ccf" code="SSM" url="http://www.crh.noaa.gov/data/APX/CCFAPX">Sault Ste Marie</location>
+ <location type="ccf" code="DTW" url="http://www.crh.noaa.gov/data/DTX/CCFDTX">Taylor</location>
+ <location type="ccf" code="TVC" url="http://www.crh.noaa.gov/data/APX/CCFAPX">Traverse City</location>
+ </state>
+ <state name="Minnesota">
+ <location type="ccf" code="AXN" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Alexandria</location>
+ <location type="ccf" code="BRD" url="http://www.crh.noaa.gov/data/DLH/CCFDLH">Brainerd</location>
+ <location type="ccf" code="DLH" url="http://www.crh.noaa.gov/data/DLH/CCFDLH">Duluth</location>
+ <location type="ccf" code="INL" url="http://www.crh.noaa.gov/data/DLH/CCFDLH">International Falls</location>
+ <location type="ccf" code="MKT" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Mankato</location>
+ <location type="ccf" code="MML" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Marshall</location>
+ <location type="ccf" code="MSP" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Minneapolis</location>
+ <location type="ccf" code="VVV" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Ortonville</location>
+ <location type="ccf" code="RST" url="http://www.crh.noaa.gov/data/ARX/CCFARX">Rochester</location>
+ <location type="ccf" code="STC" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Saint Cloud</location>
+ <location type="ccf" code="ETH" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Wheaton</location>
+ <location type="ccf" code="ILL" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Willmar</location>
+ <location type="ccf" code="OTG" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Worthington</location>
+ </state>
+ <state name="Mississippi">
+ <location type="ccf" code="GPT" url="http://www.crh.noaa.gov/data/LIX/CCFLIX">Gulfport</location>
+ <location type="ccf" code="JAN" url="http://www.crh.noaa.gov/data/JAN/CCFJAN">Jackson</location>
+ <location type="ccf" code="MCB" url="http://www.crh.noaa.gov/data/LIX/CCFLIX">McComb</location>
+ <location type="ccf" code="MEI" url="http://www.crh.noaa.gov/data/JAN/CCFJAN">Meridian</location>
+ <location type="ccf" code="TUP" url="http://www.crh.noaa.gov/data/MEG/CCFMEG">Tupelo</location>
+ </state>
+ <state name="Missouri">
+ <location type="ccf" code="CGI" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Cape Girardeau</location>
+ <location type="ccf" code="FAM" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Farmington</location>
+ <location type="ccf" code="MCI" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Gladstone</location>
+ <location type="ccf" code="JLN" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">Joplin</location>
+ <location type="ccf" code="MKC" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Kansas City</location>
+ <location type="ccf" code="AIZ" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">Kaiser Lake Ozark</location>
+ <location type="ccf" code="IRK" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Kirksville</location>
+ <location type="ccf" code="COU" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Columbia</location>
+ <location type="ccf" code="JEF" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Jefferson City</location>
+ <location type="ccf" code="POF" url="http://www.crh.noaa.gov/data/PAH/CCFPAH">Poplar Bluff</location>
+ <location type="ccf" code="STJ" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Saint Joseph</location>
+ <location type="ccf" code="STL" url="http://www.crh.noaa.gov/data/LSX/CCFLSX">Saint Louis</location>
+ <location type="ccf" code="DMO" url="http://www.crh.noaa.gov/data/EAX/CCFEAX">Sedalia</location>
+ <location type="ccf" code="SGF" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">Springfield</location>
+ <location type="ccf" code="VIH" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">Vichy-Rolla</location>
+ <location type="ccf" code="UNO" url="http://www.crh.noaa.gov/data/SGF/CCFSGF">West Plains</location>
+ </state>
+ <state name="Montana">
+ <location type="ccf" code="BIL" url="http://www.crh.noaa.gov/data/BYZ/CCFBYZ">Billings</location>
+ <location type="ccf" code="BZN" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Bozeman</location>
+ <location type="ccf" code="BTM" url="http://www.crh.noaa.gov/data/MSO/CCFMSO">Butte</location>
+ <location type="ccf" code="CTB" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Cut Bank</location>
+ <location type="ccf" code="DLN" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Dillon</location>
+ <location type="ccf" code="GTF" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Great Falls</location>
+ <location type="ccf" code="HVR" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Havre</location>
+ <location type="ccf" code="HLN" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Helena</location>
+ <location type="ccf" code="FCA" url="http://www.crh.noaa.gov/data/MSO/CCFMSO">Kalispell</location>
+ <location type="ccf" code="LWT" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">Lewiston</location>
+ <location type="ccf" code="MLS" url="http://www.crh.noaa.gov/data/BYZ/CCFBYZ">Miles City</location>
+ <location type="ccf" code="MSO" url="http://www.crh.noaa.gov/data/MSO/CCFMSO">Missoula</location>
+ <location type="ccf" code="WEY" url="http://www.crh.noaa.gov/data/TFX/CCFTFX">West Yellowstone</location>
+ </state>
+ <state name="Nebraska">
+ <location type="ccf" code="AUH" url="http://www.crh.noaa.gov/data/GID/CCFGID">Aurora</location>
+ <location type="ccf" code="K20" url="http://www.crh.noaa.gov/data/JKL/CCFJKL">Burwell</location>
+ <location type="ccf" code="CDR" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Chadron</location>
+ <location type="ccf" code="FNB" url="http://www.crh.noaa.gov/data/OAX/CCFOAX">Falls City</location>
+ <location type="ccf" code="GRI" url="http://www.crh.noaa.gov/data/GID/CCFGID">Grand Island</location>
+ <location type="ccf" code="HSI" url="http://www.crh.noaa.gov/data/GID/CCFGID">Hastings</location>
+ <location type="ccf" code="HJH" url="http://www.crh.noaa.gov/data/GID/CCFGID">Hebron</location>
+ <location type="ccf" code="HDE" url="http://www.crh.noaa.gov/data/GID/CCFGID">Holdrege</location>
+ <location type="ccf" code="EAR" url="http://www.crh.noaa.gov/data/GID/CCFGID">Kearney</location>
+ <location type="ccf" code="LXN" url="http://www.crh.noaa.gov/data/GID/CCFGID">Lexington</location>
+ <location type="ccf" code="LNK" url="http://www.crh.noaa.gov/data/OAX/CCFOAX">Lincoln</location>
+ <location type="ccf" code="MCK" url="http://www.crh.noaa.gov/data/GLD/CCFGLD">McCook</location>
+ <location type="ccf" code="OFK" url="http://www.crh.noaa.gov/data/OAX/CCFOAX">Norfolk</location>
+ <location type="ccf" code="LBF" url="http://www.crh.noaa.gov/data/LBF/CCFLBF">North Platte</location>
+ <location type="ccf" code="OMA" url="http://www.crh.noaa.gov/data/OAX/CCFOAX">Omaha</location>
+ <location type="ccf" code="ODX" url="http://www.crh.noaa.gov/data/GID/CCFGID">Ord-Sharp</location>
+ <location type="ccf" code="BFF" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Scottsbluff</location>
+ <location type="ccf" code="SNY" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Sidney</location>
+ <location type="ccf" code="TQE" url="http://www.crh.noaa.gov/data/OAX/CCFOAX">Tekamah</location>
+ <location type="ccf" code="VTN" url="http://www.crh.noaa.gov/data/LBF/CCFLBF">Valentine</location>
+ <location type="ccf" code="JYR" url="http://www.crh.noaa.gov/data/GID/CCFGID">York</location>
+ </state>
+ <state name="Nevada">
+ <location type="ccf" code="EKO" url="http://www.crh.noaa.gov/data/LKN/CCFLKN">Elko</location>
+ <location type="ccf" code="ELY" url="http://www.crh.noaa.gov/data/LKN/CCFLKN">Ely</location>
+ <location type="ccf" code="NFL" url="http://www.crh.noaa.gov/data/REV/CCFREV">Fallon</location>
+ <location type="ccf" code="LAS" url="http://www.crh.noaa.gov/data/VEF/CCFVEF">Las Vegas</location>
+ <location type="ccf" code="NFL" url="http://www.crh.noaa.gov/data/REV/CCFREV">Lovelock</location>
+ <location type="ccf" code="RNO" url="http://www.crh.noaa.gov/data/REV/CCFREV">Reno</location>
+ <location type="ccf" code="TPH" url="http://www.crh.noaa.gov/data/LKN/CCFLKN">Tonopah</location>
+ <location type="ccf" code="WMC" url="http://www.crh.noaa.gov/data/LKN/CCFLKN">Winnemucca</location>
+ </state>
+ <state name="New Hampshire">
+ <location type="ccf" code="EEN" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Keene</location>
+ <location type="ccf" code="LCI" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Laconia</location>
+ <location type="ccf" code="LEB" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Lebanon</location>
+ <location type="ccf" code="MHT" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Manchester</location>
+ <location type="ccf" code="PSM" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Portsmouth</location>
+ <location type="ccf" code="HIE" url="http://www.crh.noaa.gov/data/GYX/CCFGYX">Whitefield</location>
+ </state>
+ <state name="New Jersey">
+ <location type="ccf" code="12N" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Andover</location>
+ <location type="ccf" code="ACY" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Atlantic City</location>
+ <location type="ccf" code="MIV" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Millville</location>
+ <location type="ccf" code="EWR" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Newark</location>
+ <location type="ccf" code="SMQ" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Somerville</location>
+ <location type="ccf" code="TEB" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Teterboro</location>
+ <location type="ccf" code="TTN" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Trenton</location>
+ </state>
+ <state name="New Mexico">
+ <location type="ccf" code="ABQ" url="http://www.crh.noaa.gov/data/ABQ/CCFABQ">Albuquerque</location>
+ <location type="ccf" code="CNM" url="http://www.crh.noaa.gov/data/MAF/CCFMAF">Carlsbad</location>
+ <location type="ccf" code="SAF" url="http://www.crh.noaa.gov/data/ABQ/CCFABQ">Santa Fe</location>
+ <location type="ccf" code="TCC" url="http://www.crh.noaa.gov/data/ABQ/CCFABQ">Tucumcari</location>
+ </state>
+ <state name="New York">
+ <location type="ccf" code="ALB" url="http://www.crh.noaa.gov/data/ALY/CCFALY">Albany</location>
+ <location type="ccf" code="GVQ" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Batavia</location>
+ <location type="ccf" code="BGM" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Binghamton</location>
+ <location type="ccf" code="BUF" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Buffalo</location>
+ <location type="ccf" code="DSV" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Dansville</location>
+ <location type="ccf" code="DKK" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Dunkirk</location>
+ <location type="ccf" code="ELM" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Elmira</location>
+ <location type="ccf" code="FRG" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Farmingdale</location>
+ <location type="ccf" code="FZY" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Fulton</location>
+ <location type="ccf" code="GFL" url="http://www.crh.noaa.gov/data/ALY/CCFALY">Glens Falls</location>
+ <location type="ccf" code="ISP" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Islip</location>
+ <location type="ccf" code="ITH" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Ithaca</location>
+ <location type="ccf" code="JHW" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Jamestown</location>
+ <location type="ccf" code="MSS" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Massena</location>
+ <location type="ccf" code="MGJ" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Montgomery</location>
+ <location type="ccf" code="MSV" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Monticello</location>
+ <city name="New York">
+ <location type="ccf" code="NYC" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Central Park</location>
+ <location type="ccf" code="JFK" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Kennedy Airport</location>
+ <location type="ccf" code="LGA" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">La Guardia Airport</location>
+ </city>
+ <location type="ccf" code="IAG" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Niagara Falls</location>
+ <location type="ccf" code="PEO" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Penn Yan</location>
+ <location type="ccf" code="POU" url="http://www.crh.noaa.gov/data/ALY/CCFALY">Poughkeepsie</location>
+ <location type="ccf" code="ROC" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Rochester</location>
+ <location type="ccf" code="ELZ" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Rushfield</location>
+ <location type="ccf" code="SLK" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Saranac Lake</location>
+ <location type="ccf" code="SYR" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Syracuse</location>
+ <location type="ccf" code="UCA" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Utica</location>
+ <location type="ccf" code="ART" url="http://www.crh.noaa.gov/data/BUF/CCFBUF">Watertown</location>
+ <location type="ccf" code="FOK" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">Westhampton</location>
+ <location type="ccf" code="HPN" url="http://www.crh.noaa.gov/data/OKX/CCFOKX">White Plains</location>
+ </state>
+ <state name="North Carolina">
+ <location type="ccf" code="VUJ" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Albemarle</location>
+ <location type="ccf" code="ECG" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Elizabeth City</location>
+ <location type="ccf" code="FAY" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Fayetteville</location>
+ <location type="ccf" code="GSB" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Goldsboro</location>
+ <location type="ccf" code="PGV" url="http://www.crh.noaa.gov/data/MHX/CCFMHX">Greenville</location>
+ <location type="ccf" code="GSO" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Greensboro</location>
+ <location type="ccf" code="HSE" url="http://www.crh.noaa.gov/data/MHX/CCFMHX">Hatteras</location>
+ <location type="ccf" code="LBT" url="http://www.crh.noaa.gov/data/ILM/CCFILM">Lumberton</location>
+ <location type="ccf" code="EWN" url="http://www.crh.noaa.gov/data/MHX/CCFMHX">New Bern</location>
+ <location type="ccf" code="RDU" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Raleigh-Durham</location>
+ <location type="ccf" code="RWI" url="http://www.crh.noaa.gov/data/RAH/CCFRDU">Rocky Mount</location>
+ <location type="ccf" code="ILM" url="http://www.crh.noaa.gov/data/ILM/CCFILM">Wilmington</location>
+ </state>
+ <state name="North Dakota">
+ <location type="ccf" code="BJI" url="http://www.crh.noaa.gov/data/FGF/CCFFGF">Bemidji</location>
+ <location type="ccf" code="BIS" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Bismarck</location>
+ <location type="ccf" code="DVL" url="http://www.crh.noaa.gov/data/FGF/CCFFGF">Devils Lake</location>
+ <location type="ccf" code="DIK" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Dickinson</location>
+ <location type="ccf" code="FAR" url="http://www.crh.noaa.gov/data/FGF/CCFFGF">Fargo</location>
+ <location type="ccf" code="GFK" url="http://www.crh.noaa.gov/data/FGF/CCFFGF">Grand Forks</location>
+ <location type="ccf" code="HEI" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Hettinger</location>
+ <location type="ccf" code="JMS" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Jamestown</location>
+ <location type="ccf" code="MOT" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Minot</location>
+ <location type="ccf" code="ISN" url="http://www.crh.noaa.gov/data/BIS/CCFBIS">Williston</location>
+ </state>
+ <state name="Ohio">
+ <location type="ccf" code="CAK" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Akron</location>
+ <location type="ccf" code="CLE" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Cleveland</location>
+ <location type="ccf" code="CMH" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Columbus</location>
+ <location type="ccf" code="DAY" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Dayton</location>
+ <location type="ccf" code="FDY" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Findlay</location>
+ <location type="ccf" code="MFD" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Mansfield</location>
+ <location type="ccf" code="PHD" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">New Philadelphia</location>
+ <location type="ccf" code="PMH" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Portsmouth</location>
+ <location type="ccf" code="SKY" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Sandusky</location>
+ <location type="ccf" code="TOL" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Toledo</location>
+ <location type="ccf" code="ILN" url="http://www.crh.noaa.gov/data/ILN/CCFILN">Wilmington</location>
+ <location type="ccf" code="YNG" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Youngstown</location>
+ <location type="ccf" code="ZZV" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Zanesville</location>
+ </state>
+ <state name="Oklahoma">
+ <location type="ccf" code="ADH" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Ada</location>
+ <location type="ccf" code="AXS" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Altus</location>
+ <location type="ccf" code="ADM" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Ardmore</location>
+ <location type="ccf" code="CLK" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Clinton</location>
+ <location type="ccf" code="DUA" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Durant</location>
+ <location type="ccf" code="WDG" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Enid</location>
+ <location type="ccf" code="GAG" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Gage</location>
+ <location type="ccf" code="F10" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Henryetta</location>
+ <location type="ccf" code="HBR" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Hobart</location>
+ <location type="ccf" code="HHW" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Hugo</location>
+ <location type="ccf" code="LAW" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Lawton</location>
+ <location type="ccf" code="OKC" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Oklahoma City</location>
+ <location type="ccf" code="MLC" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">McAlester</location>
+ <location type="ccf" code="MIA" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Miami</location>
+ <location type="ccf" code="MKO" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Muskogee</location>
+ <location type="ccf" code="PNC" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Ponca City</location>
+ <location type="ccf" code="SWO" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Stillwater</location>
+ <location type="ccf" code="TUL" url="http://www.crh.noaa.gov/data/TSA/CCFTSA">Tulsa</location>
+ <location type="ccf" code="WDG" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Woodring</location>
+ <location type="ccf" code="WWR" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Woodward</location>
+ </state>
+ <state name="Oregon">
+ <location type="ccf" code="AST" url="http://www.crh.noaa.gov/data/PQR/CCFPQR">Astoria</location>
+ <location type="ccf" code="BKE" url="http://www.crh.noaa.gov/data/BOI/CCFBOI">Baker City</location>
+ <location type="ccf" code="4BK" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Brookings</location>
+ <location type="ccf" code="BNO" url="http://www.crh.noaa.gov/data/BOI/CCFBOI">Burns</location>
+ <location type="ccf" code="EUG" url="http://www.crh.noaa.gov/data/PQR/CCFPQR">Eugene</location>
+ <location type="ccf" code="LMT" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Klamath Falls</location>
+ <location type="ccf" code="LKV" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Lakeview</location>
+ <location type="ccf" code="MFR" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Medford</location>
+ <location type="ccf" code="MHS" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Mount Shasta</location>
+ <location type="ccf" code="OTH" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">North Bend</location>
+ <location type="ccf" code="PDX" url="http://www.crh.noaa.gov/data/PQR/CCFPQR">Portland</location>
+ <location type="ccf" code="RBG" url="http://www.crh.noaa.gov/data/MFR/CCFMFR">Roseburg</location>
+ <location type="ccf" code="SLE" url="http://www.crh.noaa.gov/data/PQR/CCFPQR">Salem</location>
+ </state>
+ <state name="Pennsylvania">
+ <location type="ccf" code="ABE" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Allentown</location>
+ <location type="ccf" code="AOO" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Altoona</location>
+ <location type="ccf" code="BFD" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Bradford</location>
+ <location type="ccf" code="BTP" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Butler</location>
+ <location type="ccf" code="DUJ" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Du Bois</location>
+ <location type="ccf" code="ERI" url="http://www.crh.noaa.gov/data/CLE/CCFCLE">Erie</location>
+ <location type="ccf" code="HZL" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Hazeltown</location>
+ <location type="ccf" code="IDI" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Indiana</location>
+ <location type="ccf" code="JST" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Johnstown</location>
+ <location type="ccf" code="LNS" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Lancaster</location>
+ <location type="ccf" code="LBE" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Latrobe</location>
+ <location type="ccf" code="MDT" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Middletown</location>
+ <location type="ccf" code="MPO" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Mount Pocono</location>
+ <location type="ccf" code="PHL" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Philadelphia</location>
+ <location type="ccf" code="PIT" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Pittsburgh</location>
+ <location type="ccf" code="RDG" url="http://www.crh.noaa.gov/data/PHI/CCFPHI">Reading</location>
+ <location type="ccf" code="AVP" url="http://www.crh.noaa.gov/data/BGM/CCFBGM">Scranton</location>
+ <location type="ccf" code="SEG" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Selinsgrove</location>
+ <location type="ccf" code="UNV" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">State College</location>
+ <location type="ccf" code="IPT" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">Williamsport</location>
+ <location type="ccf" code="THV" url="http://www.crh.noaa.gov/data/CTP/CCFCTP">York</location>
+ </state>
+ <state name="Rhode Island">
+ <location type="ccf" code="PVD" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Providence</location>
+ <location type="ccf" code="WST" url="http://www.crh.noaa.gov/data/BOX/CCFBOX">Westerly</location>
+ </state>
+ <state name="South Carolina">
+ <location type="ccf" code="AND" url="http://www.crh.noaa.gov/data/GSP/CCFGSP">Anderson</location>
+ <location type="ccf" code="NBC" url="http://www.crh.noaa.gov/data/CHS/CCFCHS">Beaufort</location>
+ <location type="ccf" code="CHS" url="http://www.crh.noaa.gov/data/CHS/CCFCHS">Charleston</location>
+ <location type="ccf" code="CAE" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">Columbia</location>
+ <location type="ccf" code="FLO" url="http://www.crh.noaa.gov/data/ILM/CCFILM">Florence</location>
+ <location type="ccf" code="GSP" url="http://www.crh.noaa.gov/data/GSP/CCFGSP">Greenville</location>
+ <location type="ccf" code="LKR" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">Lancaster</location>
+ <location type="ccf" code="S19" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">McCormick</location>
+ <location type="ccf" code="MYR" url="http://www.crh.noaa.gov/data/ILM/CCFILM">Myrtle Beach</location>
+ <location type="ccf" code="27J" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">Newberry</location>
+ <location type="ccf" code="SAV" url="http://www.crh.noaa.gov/data/CHS/CCFCHS">Savannah</location>
+ <location type="ccf" code="GSP" url="http://www.crh.noaa.gov/data/GSP/CCFGSP">Spartanburg</location>
+ <location type="ccf" code="SSC" url="http://www.crh.noaa.gov/data/CAE/CCFCAE">Sumter</location>
+ <location type="ccf" code="RBW" url="http://www.crh.noaa.gov/data/CHS/CCFCHS">Walterboro</location>
+ </state>
+ <state name="South Dakota">
+ <location type="ccf" code="ABR" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Aberdeen</location>
+ <location type="ccf" code="9V9" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Chamberlain</location>
+ <location type="ccf" code="CUT" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Custer</location>
+ <location type="ccf" code="D07" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Faith</location>
+ <location type="ccf" code="HON" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Huron</location>
+ <location type="ccf" code="MHE" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Mitchell</location>
+ <location type="ccf" code="MBG" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Mobridge</location>
+ <location type="ccf" code="PHP" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Philip</location>
+ <location type="ccf" code="PIR" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Pierre</location>
+ <location type="ccf" code="IEN" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Pine Ridge</location>
+ <location type="ccf" code="RAP" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Rapid City</location>
+ <location type="ccf" code="8D3" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Sesseton</location>
+ <location type="ccf" code="FSD" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Sioux Falls</location>
+ <location type="ccf" code="ATY" url="http://www.crh.noaa.gov/data/ABR/CCFABR">Watertown</location>
+ <location type="ccf" code="SFD" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Winner</location>
+ <location type="ccf" code="YKN" url="http://www.crh.noaa.gov/data/FSD/CCFFSD">Yankton</location>
+ </state>
+ <state name="Tennesee">
+ <location type="ccf" code="TRI" url="http://www.crh.noaa.gov/data/MRX/CCFMRX">Bristol</location>
+ <location type="ccf" code="CHA" url="http://www.crh.noaa.gov/data/MRX/CCFMRX">Chattanooga</location>
+ <location type="ccf" code="CKV" url="http://www.crh.noaa.gov/data/OHX/CCFOHX">Clarksville</location>
+ <location type="ccf" code="CSV" url="http://www.crh.noaa.gov/data/OHX/CCFOHX">Crossville</location>
+ <location type="ccf" code="MKL" url="http://www.crh.noaa.gov/data/MEG/CCFMEG">Jackson</location>
+ <location type="ccf" code="TYS" url="http://www.crh.noaa.gov/data/MRX/CCFMRX">Knoxville</location>
+ <location type="ccf" code="MEM" url="http://www.crh.noaa.gov/data/MEG/CCFMEG">Memphis</location>
+ <location type="ccf" code="BNA" url="http://www.crh.noaa.gov/data/OHX/CCFOHX">Nashville</location>
+ </state>
+ <state name="Texas">
+ <location type="ccf" code="ABI" url="http://www.crh.noaa.gov/data/SJT/CCFSJT">Abilene</location>
+ <location type="ccf" code="ALI" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">alice</location>
+ <location type="ccf" code="AMA" url="http://www.crh.noaa.gov/data/AMA/CCFAMA">Amarillo</location>
+ <location type="ccf" code="AUS" url="http://www.crh.noaa.gov/data/EWX/CCFEWX">Austin</location>
+ <location type="ccf" code="BPT" url="http://www.crh.noaa.gov/data/LCH/CCFLCH">Beaumont</location>
+ <location type="ccf" code="BGD" url="http://www.crh.noaa.gov/data/AMA/CCFAMA">Borger</location>
+ <location type="ccf" code="BRO" url="http://www.crh.noaa.gov/data/BRO/CCFBRO">Brownsville</location>
+ <location type="ccf" code="CLL" url="http://www.crh.noaa.gov/data/HGX/CCFHGX">College Station</location>
+ <location type="ccf" code="CRP" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">Corpus Christi</location>
+ <location type="ccf" code="CRS" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Corsicana</location>
+ <location type="ccf" code="COT" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">Cotulla</location>
+ <location type="ccf" code="DHT" url="http://www.crh.noaa.gov/data/AMA/CCFAMA">Dalhart</location>
+ <location type="ccf" code="DAL" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Dallas</location>
+ <location type="ccf" code="DFW" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Dallas / Fort Worth</location>
+ <location type="ccf" code="DRT" url="http://www.crh.noaa.gov/data/EWX/CCFEWX">Del Rio</location>
+ <location type="ccf" code="DTO" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Denton</location>
+ <location type="ccf" code="ELP" url="http://www.crh.noaa.gov/data/EPZ/CCFEPZ">El Paso</location>
+ <location type="ccf" code="FST" url="http://www.crh.noaa.gov/data/MAF/CCFMAF">Fort Stockton</location>
+ <location type="ccf" code="GLS" url="http://www.crh.noaa.gov/data/HGX/CCFHGX">Galveston</location>
+ <location type="ccf" code="GUY" url="http://www.crh.noaa.gov/data/AMA/CCFAMA">Guymon</location>
+ <location type="ccf" code="IAH" url="http://www.crh.noaa.gov/data/HGX/CCFHGX">Houston</location>
+ <location type="ccf" code="JCT" url="http://www.crh.noaa.gov/data/SJT/CCFSJT">Junction</location>
+ <location type="ccf" code="LRD" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">Laredo</location>
+ <location type="ccf" code="LBB" url="http://www.crh.noaa.gov/data/LUB/CCFLUB">Lubbock</location>
+ <location type="ccf" code="LFK" url="http://www.crh.noaa.gov/data/SHV/CCFSHV">Lufkin</location>
+ <location type="ccf" code="MRF" url="http://www.crh.noaa.gov/data/MAF/CCFMAF">Marfa</location>
+ <location type="ccf" code="TKI" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Mc Kinney</location>
+ <location type="ccf" code="MFE" url="http://www.crh.noaa.gov/data/BRO/CCFBRO">McAllen</location>
+ <location type="ccf" code="MAF" url="http://www.crh.noaa.gov/data/MAF/CCFMAF">Midland</location>
+ <location type="ccf" code="PRX" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Paris</location>
+ <location type="ccf" code="BPT" url="http://www.crh.noaa.gov/data/LCH/CCFLCH">Port Arthur</location>
+ <location type="ccf" code="RKP" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">Rockport</location>
+ <location type="ccf" code="SJT" url="http://www.crh.noaa.gov/data/SJT/CCFSJT">San Angelo</location>
+ <location type="ccf" code="SAT" url="http://www.crh.noaa.gov/data/EWX/CCFEWX">San Antonio</location>
+ <location type="ccf" code="TPL" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Temple</location>
+ <location type="ccf" code="TRL" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Terrell</location>
+ <location type="ccf" code="TYR" url="http://www.crh.noaa.gov/data/SHV/CCFSHV">Tyler</location>
+ <location type="ccf" code="VCT" url="http://www.crh.noaa.gov/data/CRP/CCFCRP">Victoria</location>
+ <location type="ccf" code="ACT" url="http://www.crh.noaa.gov/data/FWD/CCFFWD">Waco</location>
+ <location type="ccf" code="SPS" url="http://www.crh.noaa.gov/data/OUN/CCFOUN">Wichita Falls</location>
+ </state>
+ <state name="Utah">
+ <location type="ccf" code="CDC" url="http://www.crh.noaa.gov/data/SLC/CCFSLC">Cedar City</location>
+ <location type="ccf" code="SLC" url="http://www.crh.noaa.gov/data/SLC/CCFSLC">Salt Lake City</location>
+ <location type="ccf" code="VEL" url="http://www.crh.noaa.gov/data/GJT/CCFGJT">Vernal</location>
+ </state>
+ <state name="Vermont">
+ <location type="ccf" code="DDH" url="http://www.crh.noaa.gov/data/ALY/CCFALY">Bennington</location>
+ <location type="ccf" code="BTV" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Burlington</location>
+ <location type="ccf" code="MPV" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Montpelier</location>
+ <location type="ccf" code="RUT" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Rutland</location>
+ <location type="ccf" code="1V4" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Saint Johnsbury</location>
+ <location type="ccf" code="VSF" url="http://www.crh.noaa.gov/data/BTV/CCFBTV">Springfield</location>
+ </state>
+ <state name="Virginia">
+ <location type="ccf" code="BCB" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Blacksburg</location>
+ <location type="ccf" code="CHO" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Charlottesville</location>
+ <location type="ccf" code="DAN" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Danville</location>
+ <location type="ccf" code="FVX" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Farmville</location>
+ <location type="ccf" code="LYH" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Lynchburg</location>
+ <location type="ccf" code="PHF" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Newport News</location>
+ <location type="ccf" code="ORF" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Norfolk</location>
+ <location type="ccf" code="ROA" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Roanoke</location>
+ <location type="ccf" code="RIC" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Richmond</location>
+ <location type="ccf" code="SBY" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Salisbury</location>
+ <location type="ccf" code="AKQ" url="http://www.crh.noaa.gov/data/AKQ/CCFAKQ">Wakefield</location>
+ </state>
+ <state name="Washington">
+ <location type="ccf" code="PSC" url="http://www.crh.noaa.gov/data/PDT/CCFPDT">Pasco</location>
+ <location type="ccf" code="SEA" url="http://www.crh.noaa.gov/data/SEW/CCFSEW">Seattle</location>
+ <location type="ccf" code="GEG" url="http://www.crh.noaa.gov/data/OTX/CCFOTX">Spokane</location>
+ <location type="ccf" code="ALW" url="http://www.crh.noaa.gov/data/PDT/CCFPDT">Walla Walla</location>
+ <location type="ccf" code="YKM" url="http://www.crh.noaa.gov/data/PDT/CCFPDT">Yakima</location>
+ </state>
+ <state name="West Virginia">
+ <location type="ccf" code="BKW" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Beckley</location>
+ <location type="ccf" code="BLF" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Bluefield</location>
+ <location type="ccf" code="CRW" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Charleston</location>
+ <location type="ccf" code="CKB" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Clarksburg</location>
+ <location type="ccf" code="EKN" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Elkins</location>
+ <location type="ccf" code="HTS" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Huntington</location>
+ <location type="ccf" code="LWB" url="http://www.crh.noaa.gov/data/RNK/CCFRNK">Lewisburg</location>
+ <location type="ccf" code="MRB" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Martinsburg</location>
+ <location type="ccf" code="MGW" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Morgantown</location>
+ <location type="ccf" code="PKB" url="http://www.crh.noaa.gov/data/RLX/CCFRLX">Parkersburg</location>
+ <location type="ccf" code="W99" url="http://www.crh.noaa.gov/data/LWX/CCFLWX">Petersburg</location>
+ <location type="ccf" code="HLG" url="http://www.crh.noaa.gov/data/PBZ/CCFPBZ">Wheeling</location>
+ </state>
+ <state name="Wisconsin">
+ <location type="ccf" code="ASX" url="http://www.crh.noaa.gov/data/DLH/CCFDLH">Ashland</location>
+ <location type="ccf" code="OVS" url="http://www.crh.noaa.gov/data/ARX/CCFARX">Boscobel</location>
+ <location type="ccf" code="DBQ" url="http://www.crh.noaa.gov/data/MLI/CCFMLI">Dubuque</location>
+ <location type="ccf" code="EAU" url="http://www.crh.noaa.gov/data/MPX/CCFMPX">Eau Claire</location>
+ <location type="ccf" code="FLD" url="http://www.crh.noaa.gov/data/MKX/CCFMKX">Fond Du Lac</location>
+ <location type="ccf" code="GRB" url="http://www.crh.noaa.gov/data/GRB/CCFGRB">Green Bay</location>
+ <location type="ccf" code="HYR" url="http://www.crh.noaa.gov/data/DLH/CCFDLH">Hayward</location>
+ <location type="ccf" code="ENW" url="http://www.crh.noaa.gov/data/MKX/CCFMKX">Kenosha</location>
+ <location type="ccf" code="LSE" url="http://www.crh.noaa.gov/data/ARX/CCFARX">La Crosse</location>
+ <location type="ccf" code="MSN" url="http://www.crh.noaa.gov/data/MKX/CCFMKX">Madison</location>
+ <location type="ccf" code="MDZ" url="http://www.crh.noaa.gov/data/ARX/CCFARX">Medford</location>
+ <location type="ccf" code="MKE" url="http://www.crh.noaa.gov/data/MKX/CCFMKX">Milwaukee</location>
+ <location type="ccf" code="RHI" url="http://www.crh.noaa.gov/data/GRB/CCFGRB">Rhinelander</location>
+ <location type="ccf" code="SBM" url="http://www.crh.noaa.gov/data/MKX/CCFMKX">Sheboygan</location>
+ <location type="ccf" code="AUW" url="http://www.crh.noaa.gov/data/GRB/CCFGRB">Wausau</location>
+ </state>
+ <state name="Wyoming">
+ <location type="ccf" code="BPI" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Big Piney</location>
+ <location type="ccf" code="BYG" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Buffalo</location>
+ <location type="ccf" code="CPR" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Casper</location>
+ <location type="ccf" code="CYS" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Cheyenne</location>
+ <location type="ccf" code="COD" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Cody</location>
+ <location type="ccf" code="DGW" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Douglas</location>
+ <location type="ccf" code="GCC" url="http://www.crh.noaa.gov/data/RAP/CCFRAP">Gillette</location>
+ <location type="ccf" code="GEY" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Greybull</location>
+ <location type="ccf" code="JAC" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Jackson</location>
+ <location type="ccf" code="LND" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Lander</location>
+ <location type="ccf" code="LAR" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Laramie</location>
+ <location type="ccf" code="RWL" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Rawlins</location>
+ <location type="ccf" code="RIW" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Riverton</location>
+ <location type="ccf" code="RKS" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Rock Springs</location>
+ <location type="ccf" code="SHR" url="http://www.crh.noaa.gov/data/BYZ/CCFBYZ">Sheridan</location>
+ <location type="ccf" code="TOR" url="http://www.crh.noaa.gov/data/CYS/CCFCYS">Torrington</location>
+ <location type="ccf" code="WRL" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Worland</location>
+ <location type="ccf" code="P60" url="http://www.crh.noaa.gov/data/RIW/CCFRIW">Yellowstone</location>
+ </state>
+ </country>
+ </region>
+</evolutionweather>
diff --git a/calendar/backends/weather/Makefile.am b/calendar/backends/weather/Makefile.am
new file mode 100644
index 000000000..a7a3f6f9b
--- /dev/null
+++ b/calendar/backends/weather/Makefile.am
@@ -0,0 +1,42 @@
+INCLUDES = \
+ -DG_LOG_DOMAIN=\"libecalbackendweather\" \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/calendar \
+ -I$(top_builddir)/calendar \
+ -I$(top_srcdir)/calendar/libical/src \
+ -I$(top_builddir)/calendar/libical/src \
+ -I$(top_srcdir)/calendar/libical/src/libical \
+ -I$(top_builddir)/calendar/libical/src/libical \
+ -I$(top_srcdir)/addressbook \
+ -I$(top_builddir)/addressbook \
+ -DWEATHER_DATADIR=\""$(weatherdatadir)"\" \
+ $(EVOLUTION_CALENDAR_CFLAGS) \
+ $(SOUP_CFLAGS)
+
+extension_LTLIBRARIES = libecalbackendweather.la
+
+libecalbackendweather_la_SOURCES = \
+ e-cal-backend-weather-factory.c \
+ e-cal-backend-weather-factory.h \
+ e-cal-backend-weather.c \
+ e-cal-backend-weather.h \
+ e-weather-source.c \
+ e-weather-source.h \
+ e-weather-source-ccf.c \
+ e-weather-source-ccf.h
+
+libecalbackendweather_la_LIBADD = \
+ $(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la \
+ $(SOUP_LIBS)
+
+libecalbackendweather_la_LDFLAGS = \
+ -avoid-version
+
+weatherdata_in_files = Locations.xml.in
+weatherdata_DATA = $(weatherdata_in_files:.xml.in=.xml)
+# FIXME - should probably do some sort of intltool merge here
+%.xml: %.xml.in
+ cp $< $@
+
+EXTRA_DIST = Locations.xml.in
diff --git a/calendar/backends/weather/e-cal-backend-weather-factory.c b/calendar/backends/weather/e-cal-backend-weather-factory.c
new file mode 100644
index 000000000..03cd4ddb7
--- /dev/null
+++ b/calendar/backends/weather/e-cal-backend-weather-factory.c
@@ -0,0 +1,114 @@
+/* Evolution calendar - weather backend factory
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <pthread.h>
+#include <string.h>
+
+#include "e-cal-backend-weather-factory.h"
+#include "e-cal-backend-weather.h"
+
+typedef struct {
+ ECalBackendFactory parent_object;
+} ECalBackendWeatherFactory;
+
+typedef struct {
+ ECalBackendWeatherClass parent_class;
+} ECalBackendWeatherFactoryClass;
+
+static void
+e_cal_backend_weather_factory_instance_init (ECalBackendWeatherFactory *factory)
+{
+}
+
+static const char *
+_get_protocol (ECalBackendFactory *factory)
+{
+ return "weather";
+}
+
+static ECalBackend*
+_events_new_backend (ECalBackendFactory *factory, ESource *source)
+{
+ return g_object_new (e_cal_backend_weather_get_type (),
+ "source", source,
+ "kind", ICAL_VEVENT_COMPONENT,
+ NULL);
+}
+
+static icalcomponent_kind
+_events_get_kind (ECalBackendFactory *factory)
+{
+ return ICAL_VEVENT_COMPONENT;
+}
+
+static void
+events_backend_factory_class_init (ECalBackendWeatherFactoryClass *klass)
+{
+ E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
+ E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind = _events_get_kind;
+ E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend = _events_new_backend;
+}
+
+static GType
+events_backend_factory_get_type (GTypeModule *module)
+{
+ GType type;
+ GTypeInfo info = {
+ sizeof (ECalBackendWeatherFactoryClass),
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) events_backend_factory_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ECalBackend),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) e_cal_backend_weather_factory_instance_init
+ };
+ type = g_type_module_register_type (module,
+ E_TYPE_CAL_BACKEND_FACTORY,
+ "ECalBackendWeatherEventsFactory",
+ &info, 0);
+
+ return type;
+}
+
+static GType weather_type[1];
+
+void
+eds_module_initialize (GTypeModule *module)
+{
+ weather_type[0] = events_backend_factory_get_type (module);
+}
+
+void
+eds_module_shutdown (void)
+{
+}
+
+void
+eds_module_list_types (const GType **types, int *num_types)
+{
+ *types = weather_type;
+ *num_types = 1;
+}
diff --git a/calendar/backends/weather/e-cal-backend-weather-factory.h b/calendar/backends/weather/e-cal-backend-weather-factory.h
new file mode 100644
index 000000000..d6459e6c4
--- /dev/null
+++ b/calendar/backends/weather/e-cal-backend-weather-factory.h
@@ -0,0 +1,35 @@
+/* Evolution calendar - weather backend factory
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef E_CAL_BACKEND_WEATHER_FACTORY_H
+#define E_CAL_BACKEND_WEATHER_FACTORY_H
+
+#include <glib-object.h>
+#include "libedata-cal/e-cal-backend-factory.h"
+
+G_BEGIN_DECLS
+
+void eds_module_initialize (GTypeModule *module);
+void eds_module_shutdown (void);
+void eds_module_list_types (const GType **types, int *num_types);
+
+G_END_DECLS
+
+#endif /* E_CAL_BACKEND_WEATHER_FACTORY_H */
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
new file mode 100644
index 000000000..455989969
--- /dev/null
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -0,0 +1,888 @@
+/* Evolution calendar - weather backend
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <config.h>
+#include <libedata-cal/e-cal-backend-cache.h>
+#include <libedata-cal/e-cal-backend-util.h>
+#include <libedata-cal/e-cal-backend-sexp.h>
+#include <libgnome/gnome-i18n.h>
+#include <string.h>
+#include "e-cal-backend-weather.h"
+#include "e-weather-source.h"
+
+#define WEATHER_UID_EXT "-weather"
+
+static gboolean reload_cb (ECalBackendWeather *cbw);
+static gboolean begin_retrieval_cb (ECalBackendWeather *cbw);
+static ECalComponent* create_weather (ECalBackendWeather *cbw, WeatherForecast *report);
+
+/* Private part of the ECalBackendWeather structure */
+struct _ECalBackendWeatherPrivate {
+ /* URI to get remote weather data from */
+ char *uri;
+
+ /* Local/remote mode */
+ CalMode mode;
+
+ /* The file cache */
+ ECalBackendCache *cache;
+
+ /* The calendar's default timezone, used for resolving DATE and
+ floating DATE-TIME values. */
+ icaltimezone *default_zone;
+ GHashTable *zones;
+
+ /* Reload */
+ guint reload_timeout_id;
+ guint source_changed_id;
+ guint is_loading : 1;
+
+ /* Flags */
+ gboolean opened;
+
+ /* Weather source */
+ EWeatherSource *source;
+};
+
+static ECalBackendSyncClass *parent_class;
+
+static gboolean
+reload_cb (ECalBackendWeather *cbw)
+{
+ ECalBackendWeatherPrivate *priv;
+
+ priv = cbw->priv;
+
+ if (priv->is_loading)
+ return TRUE;
+
+ priv->reload_timeout_id = 0;
+ priv->opened = TRUE;
+ begin_retrieval_cb (cbw);
+ return FALSE;
+}
+
+static void
+source_changed (ESource *source, ECalBackendWeather *cbw)
+{
+ /* FIXME
+ * We should force a reload of the data when this gets called. Unfortunately,
+ * this signal isn't getting through from evolution to the backend
+ */
+}
+
+static void
+maybe_start_reload_timeout (ECalBackendWeather *cbw)
+{
+ ECalBackendWeatherPrivate *priv;
+ ESource *source;
+ const gchar *refresh_str;
+
+ priv = cbw->priv;
+
+ if (priv->reload_timeout_id)
+ return;
+
+ source = e_cal_backend_get_source (E_CAL_BACKEND (cbw));
+ if (!source) {
+ g_warning ("Could not get source for ECalBackendWeather reload.");
+ return;
+ }
+
+ if (priv->source_changed_id == 0)
+ priv->source_changed_id = g_signal_connect (G_OBJECT (source),
+ "changed",
+ G_CALLBACK (source_changed),
+ cbw);
+
+ refresh_str = e_source_get_property (source, "refresh");
+
+ /* By default, reload every 4 hours. At least for CCF, the forecasts only come out
+ * twice a day, and chances are while the NWS and similar organizations have some
+ * serious bandwidth, they would appreciate it if we didn't hammer their servers
+ */
+ priv->reload_timeout_id = g_timeout_add ((refresh_str ? atoi (refresh_str) : 240) * 60000,
+ (GSourceFunc) reload_cb, cbw);
+
+}
+
+static void
+finished_retrieval_cb (GList *forecasts, ECalBackendWeather *cbw)
+{
+ ECalBackendWeatherPrivate *priv;
+ ECalComponent *comp;
+ icalcomponent *icomp;
+ GList *l;
+
+ priv = cbw->priv;
+
+ if (forecasts == NULL) {
+ e_cal_backend_notify_error (E_CAL_BACKEND (cbw), _("Could not retrieve weather data"));
+ return;
+ }
+
+ /* update cache */
+ l = e_cal_backend_cache_get_components (priv->cache);
+ for (; l != NULL; l = g_list_next (l)) {
+ icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (l->data));
+ e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbw),
+ icalcomponent_get_uid (icomp),
+ icalcomponent_as_ical_string (icomp),
+ NULL);
+ g_object_unref (G_OBJECT (l->data));
+ }
+ g_list_free (l);
+ e_file_cache_clean (E_FILE_CACHE (priv->cache));
+
+ for (l = forecasts; l != NULL; l = g_list_next (l)) {
+ comp = create_weather (cbw, l->data);
+ e_cal_backend_cache_put_component (priv->cache, comp);
+ icomp = e_cal_component_get_icalcomponent (comp);
+ e_cal_backend_notify_object_created (E_CAL_BACKEND (cbw), icalcomponent_as_ical_string (icomp));
+ }
+
+ priv->is_loading = FALSE;
+}
+
+static gboolean
+begin_retrieval_cb (ECalBackendWeather *cbw)
+{
+ ECalBackendWeatherPrivate *priv = cbw->priv;
+
+ if (priv->mode != CAL_MODE_REMOTE)
+ return TRUE;
+
+ maybe_start_reload_timeout (cbw);
+
+ if (priv->source == NULL)
+ priv->source = e_weather_source_new (e_cal_backend_get_uri (E_CAL_BACKEND (cbw)));
+
+ if (priv->is_loading)
+ return FALSE;
+
+ priv->is_loading = TRUE;
+
+ e_weather_source_parse (priv->source, (EWeatherSourceFinished) finished_retrieval_cb, cbw);
+
+ return FALSE;
+}
+
+static const char*
+getConditions (WeatherForecast *report)
+{
+ switch (report->conditions) {
+ case WEATHER_FAIR: return _("Fair");
+ case WEATHER_SNOW_SHOWERS: return _("Snow showers");
+ case WEATHER_SNOW: return _("Snow");
+ case WEATHER_PARTLY_CLOUDY: return _("Partly cloudy");
+ case WEATHER_SMOKE: return _("Smoke");
+ case WEATHER_THUNDERSTORMS: return _("Thunderstorms");
+ case WEATHER_CLOUDY: return _("Cloudy");
+ case WEATHER_DRIZZLE: return _("Drizzle");
+ case WEATHER_SUNNY: return _("Sunny");
+ case WEATHER_DUST: return _("Dust");
+ case WEATHER_CLEAR: return _("Clear");
+ case WEATHER_MOSTLY_CLOUDY: return _("Mostly cloudy");
+ case WEATHER_WINDY: return _("Windy");
+ case WEATHER_RAIN_SHOWERS: return _("Rain showers");
+ case WEATHER_FOGGY: return _("Foggy");
+ case WEATHER_RAIN_OR_SNOW_MIXED: return _("Rain/snow mixed");
+ case WEATHER_SLEET: return _("Sleet");
+ case WEATHER_VERY_HOT_OR_HOT_HUMID: return _("Very hot/humid");
+ case WEATHER_BLIZZARD: return _("Blizzard");
+ case WEATHER_FREEZING_RAIN: return _("Freezing rain");
+ case WEATHER_HAZE: return _("Haze");
+ case WEATHER_BLOWING_SNOW: return _("Blowing snow");
+ case WEATHER_FREEZING_DRIZZLE: return _("Freezing drizzle");
+ case WEATHER_VERY_COLD_WIND_CHILL: return _("Very cold/wind chill");
+ case WEATHER_RAIN: return _("Rain");
+ default: return NULL;
+ }
+}
+
+static const char*
+getCategory (WeatherForecast *report)
+{
+ /* Right now this is based on which icons we have available */
+ switch (report->conditions) {
+ case WEATHER_FAIR: return _("Weather: Sunny");
+ case WEATHER_SNOW_SHOWERS: return _("Weather: Snow");
+ case WEATHER_SNOW: return _("Weather: Snow");
+ case WEATHER_PARTLY_CLOUDY: return _("Weather: Partly Cloudy");
+ case WEATHER_SMOKE: return _("Weather: Fog");
+ case WEATHER_THUNDERSTORMS: return _("Weather: Thunderstorms");
+ case WEATHER_CLOUDY: return _("Weather: Cloudy");
+ case WEATHER_DRIZZLE: return _("Weather: Rain");
+ case WEATHER_SUNNY: return _("Weather: Sunny");
+ case WEATHER_DUST: return _("Weather: Fog");
+ case WEATHER_CLEAR: return _("Weather: Sunny");
+ case WEATHER_MOSTLY_CLOUDY: return _("Weather: Cloudy");
+ case WEATHER_WINDY: return _("");
+ case WEATHER_RAIN_SHOWERS: return _("Weather: Rain");
+ case WEATHER_FOGGY: return _("Weather: Fog");
+ case WEATHER_RAIN_OR_SNOW_MIXED: return _("Weather: Rain");
+ case WEATHER_SLEET: return _("Weather: Rain");
+ case WEATHER_VERY_HOT_OR_HOT_HUMID: return _("Weather: Sunny");
+ case WEATHER_BLIZZARD: return _("Weather: Snow");
+ case WEATHER_FREEZING_RAIN: return _("Weather: Rain");
+ case WEATHER_HAZE: return _("Weather: Fog");
+ case WEATHER_BLOWING_SNOW: return _("Weather: Snow");
+ case WEATHER_FREEZING_DRIZZLE: return _("Weather: Rain");
+ case WEATHER_VERY_COLD_WIND_CHILL: return _("");
+ case WEATHER_RAIN: return _("Weather: Rain");
+ default: return NULL;
+ }
+}
+
+static float
+ctof (float c)
+{
+ return ((c * 9.0f / 5.0f) + 32.0f);
+}
+
+static float
+cmtoin (float cm)
+{
+ return cm / 2.54f;
+}
+
+static ECalComponent*
+create_weather (ECalBackendWeather *cbw, WeatherForecast *report)
+{
+ ECalComponent *cal_comp;
+ ECalComponentText comp_summary;
+ icalcomponent *ical_comp;
+ struct icaltimetype itt;
+ ECalComponentDateTime dt;
+ const char *uid;
+ GSList *text_list = NULL;
+ ECalComponentText *description;
+ char *pop, *snow;
+ ESource *source;
+ gboolean fahrenheit, inches;
+ const char *format;
+
+ g_return_val_if_fail (E_IS_CAL_BACKEND_WEATHER (cbw), NULL);
+
+ source = e_cal_backend_get_source (E_CAL_BACKEND (cbw));
+ format = e_source_get_property (source, "temperature");
+ if (format == NULL)
+ fahrenheit = FALSE;
+ else
+ fahrenheit = (strcmp (format, "fahrenheit") == 0);
+ format = e_source_get_property (source, "snowfall");
+ if (format == NULL)
+ inches = FALSE;
+ else
+ inches = (strcmp (format, "inches") == 0);
+
+ /* create the component and event object */
+ ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
+ cal_comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (cal_comp, ical_comp);
+
+ /* set uid */
+ uid = e_cal_component_gen_uid ();
+ e_cal_component_set_uid (cal_comp, uid);
+
+ /* Set all-day event's date from forecast data */
+ itt = icaltime_from_timet (report->date, 1);
+ dt.value = &itt;
+ dt.tzid = NULL;
+ e_cal_component_set_dtstart (cal_comp, &dt);
+
+ itt = icaltime_from_timet (report->date, 1);
+ icaltime_adjust (&itt, 1, 0, 0, 0);
+ dt.value = &itt;
+ dt.tzid = NULL;
+ /* We have to add 1 day to DTEND, as it is not inclusive. */
+ e_cal_component_set_dtend (cal_comp, &dt);
+
+ /* The summary is the high or high/low temperatures */
+ if (report->high == report->low) {
+ if (fahrenheit)
+ comp_summary.value = g_strdup_printf (_("%.1f°F"), ctof (report->high));
+ else
+ comp_summary.value = g_strdup_printf (_("%.1f°C"), report->high);
+ } else {
+ if (fahrenheit)
+ comp_summary.value = g_strdup_printf (_("%.1f/%.1f°F"), ctof (report->high), ctof (report->low));
+ else
+ comp_summary.value = g_strdup_printf (_("%.1f/%.1f°C"), report->high, report->low);
+ }
+ comp_summary.altrep = NULL;
+ e_cal_component_set_summary (cal_comp, &comp_summary);
+
+ if (report->pop != 0)
+ pop = g_strdup_printf (_("%d%% chance of precipitation\n"), report->pop);
+ else
+ pop = "";
+ if (report->snowhigh == 0)
+ snow = "";
+ else if (report->snowhigh == report->snowlow) {
+ if (inches)
+ snow = g_strdup_printf (_("%.1fin snow\n"), cmtoin(report->snowhigh));
+ else
+ snow = g_strdup_printf (_("%.1fcm snow\n"), report->snowhigh);
+ } else {
+ if (inches)
+ snow = g_strdup_printf (_("%.1f-%.1fin snow\n"), cmtoin(report->snowlow), cmtoin(report->snowhigh));
+ else
+ snow = g_strdup_printf (_("%.1f-%.1fcm snow\n"), report->snowlow, report->snowhigh);
+ }
+ description = g_new0 (ECalComponentText, 1);
+ description->value = g_strdup_printf ("%s\n%s%s", getConditions (report), pop, snow);
+ description->altrep = "";
+ text_list = g_slist_append (text_list, description);
+ e_cal_component_set_description_list (cal_comp, text_list);
+
+ /* Set category and visibility */
+ e_cal_component_set_categories (cal_comp, getCategory (report));
+ e_cal_component_set_classification (cal_comp, E_CAL_COMPONENT_CLASS_PUBLIC);
+
+ /* Weather is shown as free time */
+ e_cal_component_set_transparency (cal_comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+
+ e_cal_component_commit_sequence (cal_comp);
+
+ g_free (pop);
+ g_free (snow);
+
+ return cal_comp;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_is_read_only (ECalBackendSync *backend, EDataCal *cal, gboolean *read_only)
+{
+ *read_only = TRUE;
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_cal_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+{
+ /* Weather has no particular email addresses associated with it */
+ *address = NULL;
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_alarm_email_address (ECalBackendSync *backend, EDataCal *cal, char **address)
+{
+ /* Weather has no particular email addresses associated with it */
+ *address = NULL;
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_ldap_attribute (ECalBackendSync *backend, EDataCal *cal, char **attribute)
+{
+ *attribute = NULL;
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static char *sc[] = {
+ CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT,
+ CAL_STATIC_CAPABILITY_NO_AUDIO_ALARMS,
+ CAL_STATIC_CAPABILITY_NO_DISPLAY_ALARMS,
+ CAL_STATIC_CAPABILITY_NO_PROCEDURE_ALARMS,
+ CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT,
+ CAL_STATIC_CAPABILITY_NO_THISANDFUTURE,
+ CAL_STATIC_CAPABILITY_NO_THISANDPRIOR,
+ NULL
+};
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_static_capabilities (ECalBackendSync *backend, EDataCal *cal, char **capabilities)
+{
+ *capabilities = sc;
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_open (ECalBackendSync *backend, EDataCal *cal, gboolean only_if_exists, const char *username, const char *password)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ if (!priv->cache) {
+ priv->cache = e_cal_backend_cache_new (e_cal_backend_get_uri (E_CAL_BACKEND (backend)));
+
+ if (!priv->cache) {
+ e_cal_backend_notify_error (E_CAL_BACKEND (cbw), _("Could not create cache file"));
+ return GNOME_Evolution_Calendar_OtherError;
+ }
+
+ if (priv->mode == CAL_MODE_LOCAL)
+ return GNOME_Evolution_Calendar_Success;
+
+ g_idle_add ((GSourceFunc) begin_retrieval_cb, cbw);
+ }
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_remove (ECalBackendSync *backend, EDataCal *cal)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ if (!priv->cache)
+ return GNOME_Evolution_Calendar_OtherError;
+
+ e_file_cache_remove (E_FILE_CACHE (priv->cache));
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_discard_alarm (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *auid)
+{
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_receive_objects (ECalBackendSync *backend, EDataCal *cal, const char *calobj)
+{
+ return GNOME_Evolution_Calendar_PermissionDenied;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_default_object (ECalBackendSync *backend, EDataCal *cal, char **object)
+{
+ return GNOME_Evolution_Calendar_UnsupportedMethod;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_object (ECalBackendSync *backend, EDataCal *cal, const char *uid, const char *rid, char **object)
+{
+ ECalBackendWeather *cbw = E_CAL_BACKEND_WEATHER (backend);
+ ECalBackendWeatherPrivate *priv = cbw->priv;
+ ECalComponent *comp;
+
+ g_return_val_if_fail (uid != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+ g_return_val_if_fail (priv->cache != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+
+ comp = e_cal_backend_cache_get_component (priv->cache, uid, rid);
+ g_return_val_if_fail (comp != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+
+ *object = e_cal_component_get_as_string (comp);
+ g_free (comp);
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_object_list (ECalBackendSync *backend, EDataCal *cal, const char *sexp_string, GList **objects)
+{
+ ECalBackendWeather *cbw = E_CAL_BACKEND_WEATHER (backend);
+ ECalBackendWeatherPrivate *priv = cbw->priv;
+ ECalBackendSExp *sexp = e_cal_backend_sexp_new (sexp_string);
+ GList *components, *l;
+
+ if (!sexp)
+ return GNOME_Evolution_Calendar_InvalidQuery;
+
+ *objects = NULL;
+ components = e_cal_backend_cache_get_components (priv->cache);
+ for (l = components; l != NULL; l = g_list_next (l)) {
+ if (e_cal_backend_sexp_match_comp (sexp, E_CAL_COMPONENT (l->data), E_CAL_BACKEND (backend)))
+ *objects = g_list_append (*objects, e_cal_component_get_as_string (l->data));
+ }
+
+ g_list_foreach (components, (GFunc) g_object_unref, NULL);
+ g_list_free (components);
+ g_object_unref (sexp);
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid, char **object)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+ icaltimezone *zone;
+ icalcomponent *icalcomp;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ g_return_val_if_fail (tzid != NULL, GNOME_Evolution_Calendar_ObjectNotFound);
+
+ zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (backend), tzid);
+ if (!zone)
+ return GNOME_Evolution_Calendar_ObjectNotFound;
+
+ icalcomp = icaltimezone_get_component (zone);
+ if (!icalcomp)
+ return GNOME_Evolution_Calendar_InvalidObject;
+
+ *object = g_strdup (icalcomponent_as_ical_string (icalcomp));
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_add_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzobj)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+ icalcomponent *tz_comp;
+ icaltimezone *zone;
+ char *tzid;
+
+ cbw = (ECalBackendWeather*) backend;
+
+ g_return_val_if_fail (E_IS_CAL_BACKEND_WEATHER (cbw), GNOME_Evolution_Calendar_OtherError);
+ g_return_val_if_fail (tzobj != NULL, GNOME_Evolution_Calendar_OtherError);
+
+ priv = cbw->priv;
+
+ tz_comp = icalparser_parse_string (tzobj);
+ g_return_val_if_fail (tz_comp != NULL, GNOME_Evolution_Calendar_InvalidObject);
+
+ if (icalcomponent_isa (tz_comp) != ICAL_VTIMEZONE_COMPONENT)
+ return GNOME_Evolution_Calendar_InvalidObject;
+
+ zone = icaltimezone_new ();
+ icaltimezone_set_component (zone, tz_comp);
+ tzid = icaltimezone_get_tzid (zone);
+
+ if (g_hash_table_lookup (priv->zones, tzid)) {
+ icaltimezone_free (zone, TRUE);
+ return GNOME_Evolution_Calendar_Success;
+ }
+
+ g_hash_table_insert (priv->zones, g_strdup (tzid), zone);
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_set_default_timezone (ECalBackendSync *backend, EDataCal *cal, const char *tzid)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ priv->default_zone = e_cal_backend_internal_get_timezone (E_CAL_BACKEND (backend), tzid);
+ if (!priv->default_zone) {
+ priv->default_zone = icaltimezone_get_utc_timezone ();
+
+ return GNOME_Evolution_Calendar_ObjectNotFound;
+ }
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GList *users, time_t start, time_t end, GList **freebusy)
+{
+ /* Weather doesn't count as busy time */
+ icalcomponent *vfb = icalcomponent_new_vfreebusy ();
+ icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
+ char *calobj;
+
+ icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
+ icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, utc_zone));
+
+ calobj = icalcomponent_as_ical_string (vfb);
+ *freebusy = g_list_append (NULL, g_strdup (calobj));
+ icalcomponent_free (vfb);
+
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static ECalBackendSyncStatus
+e_cal_backend_weather_get_changes (ECalBackendSync *backend, EDataCal *cal, const char *change_id, GList **adds, GList **modifies, GList **deletes)
+{
+ return GNOME_Evolution_Calendar_Success;
+}
+
+static gboolean
+e_cal_backend_weather_is_loaded (ECalBackend *backend)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ if (!priv->cache)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void e_cal_backend_weather_start_query (ECalBackend *backend, EDataCalView *query)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+ ECalBackendSExp *sexp;
+ GList *components, *l, *objects;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ if (!priv->cache) {
+ e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_NoSuchCal);
+ return;
+ }
+
+ sexp = e_data_cal_view_get_object_sexp (query);
+ if (!sexp) {
+ e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_InvalidQuery);
+ return;
+ }
+
+ objects = NULL;
+ components = e_cal_backend_cache_get_components (priv->cache);
+ for (l = components; l != NULL; l = g_list_next (l)) {
+ if (e_cal_backend_sexp_match_comp (sexp, E_CAL_COMPONENT (l->data), backend))
+ objects = g_list_append (objects, e_cal_component_get_as_string (l->data));
+ }
+
+ if (objects)
+ e_data_cal_view_notify_objects_added (query, (const GList *) objects);
+
+ g_list_foreach (components, (GFunc) g_object_unref, NULL);
+ g_list_free (components);
+ g_list_foreach (objects, (GFunc) g_free, NULL);
+ g_list_free (objects);
+ g_object_unref (sexp);
+
+ e_data_cal_view_notify_done (query, GNOME_Evolution_Calendar_Success);
+}
+
+static CalMode
+e_cal_backend_weather_get_mode (ECalBackend *backend)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ return priv->mode;
+}
+
+static void
+e_cal_backend_weather_set_mode (ECalBackend *backend, CalMode mode)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+ GNOME_Evolution_Calendar_CalMode set_mode;
+ gboolean loaded;
+
+ cbw = E_CAL_BACKEND_WEATHER (backend);
+ priv = cbw->priv;
+
+ loaded = e_cal_backend_weather_is_loaded (backend);
+
+ switch (mode) {
+ case CAL_MODE_LOCAL:
+ case CAL_MODE_REMOTE:
+ priv->mode = mode;
+ set_mode = cal_mode_to_corba (mode);
+ if (loaded && priv->reload_timeout_id) {
+ g_source_remove (priv->reload_timeout_id);
+ priv->reload_timeout_id = 0;
+ }
+ break;
+ case CAL_MODE_ANY:
+ priv->mode = mode;
+ set_mode = cal_mode_to_corba (mode);
+ if (loaded)
+ g_idle_add ((GSourceFunc) begin_retrieval_cb, backend);
+ break;
+ default:
+ set_mode = GNOME_Evolution_Calendar_MODE_ANY;
+ break;
+ }
+
+ if (loaded) {
+ if (set_mode == GNOME_Evolution_Calendar_MODE_ANY)
+ e_cal_backend_notify_mode (backend,
+ GNOME_Evolution_Calendar_CalListener_MODE_NOT_SUPPORTED,
+ cal_mode_to_corba (priv->mode));
+ else
+ e_cal_backend_notify_mode (backend,
+ GNOME_Evolution_Calendar_CalListener_MODE_SET,
+ set_mode);
+ }
+}
+
+static icaltimezone *
+e_cal_backend_weather_internal_get_default_timezone (ECalBackend *backend)
+{
+ ECalBackendWeather *cbw = E_CAL_BACKEND_WEATHER (backend);
+
+ return cbw->priv->default_zone;
+}
+
+static icaltimezone *
+e_cal_backend_weather_internal_get_timezone (ECalBackend *backend, const char *tzid)
+{
+ icaltimezone *zone;
+ if (!strcmp (tzid, "UTC"))
+ zone = icaltimezone_get_utc_timezone ();
+ else
+ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+ return zone;
+}
+
+static void
+free_zone (gpointer data)
+{
+ icaltimezone_free (data, TRUE);
+}
+
+/* Finalize handler for the weather backend */
+static void
+e_cal_backend_weather_finalize (GObject *object)
+{
+ ECalBackendWeather *cbw;
+ ECalBackendWeatherPrivate *priv;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_CAL_BACKEND_WEATHER (object));
+
+ cbw = (ECalBackendWeather *) object;
+ priv = cbw->priv;
+
+ if (priv->cache) {
+ g_object_unref (priv->cache);
+ priv->cache = NULL;
+ }
+
+ g_hash_table_destroy (priv->zones);
+
+ g_free (priv);
+ cbw->priv = NULL;
+
+ if (G_OBJECT_CLASS (parent_class)->finalize)
+ (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+}
+
+/* Object initialization function for the weather backend */
+static void
+e_cal_backend_weather_init (ECalBackendWeather *cbw, ECalBackendWeatherClass *class)
+{
+ ECalBackendWeatherPrivate *priv;
+
+ priv = g_new0 (ECalBackendWeatherPrivate, 1);
+
+ cbw->priv = priv;
+
+ priv->reload_timeout_id = 0;
+ priv->source_changed_id = 0;
+ priv->opened = FALSE;
+ priv->source = NULL;
+ priv->cache = NULL;
+
+ priv->zones = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_zone);
+}
+
+/* Class initialization function for the weather backend */
+static void
+e_cal_backend_weather_class_init (ECalBackendWeatherClass *class)
+{
+ GObjectClass *object_class;
+ ECalBackendClass *backend_class;
+ ECalBackendSyncClass *sync_class;
+
+ object_class = (GObjectClass *) class;
+ backend_class = (ECalBackendClass *) class;
+ sync_class = (ECalBackendSyncClass *) class;
+
+ parent_class = (ECalBackendSyncClass *) g_type_class_peek_parent (class);
+
+ object_class->finalize = e_cal_backend_weather_finalize;
+
+ sync_class->is_read_only_sync = e_cal_backend_weather_is_read_only;
+ sync_class->get_cal_address_sync = e_cal_backend_weather_get_cal_address;
+ sync_class->get_alarm_email_address_sync = e_cal_backend_weather_get_alarm_email_address;
+ sync_class->get_ldap_attribute_sync = e_cal_backend_weather_get_ldap_attribute;
+ sync_class->get_static_capabilities_sync = e_cal_backend_weather_get_static_capabilities;
+ sync_class->open_sync = e_cal_backend_weather_open;
+ sync_class->remove_sync = e_cal_backend_weather_remove;
+ sync_class->discard_alarm_sync = e_cal_backend_weather_discard_alarm;
+ sync_class->receive_objects_sync = e_cal_backend_weather_receive_objects;
+ sync_class->get_default_object_sync = e_cal_backend_weather_get_default_object;
+ sync_class->get_object_sync = e_cal_backend_weather_get_object;
+ sync_class->get_object_list_sync = e_cal_backend_weather_get_object_list;
+ sync_class->get_timezone_sync = e_cal_backend_weather_get_timezone;
+ sync_class->add_timezone_sync = e_cal_backend_weather_add_timezone;
+ sync_class->set_default_timezone_sync = e_cal_backend_weather_set_default_timezone;
+ sync_class->get_freebusy_sync = e_cal_backend_weather_get_free_busy;
+ sync_class->get_changes_sync = e_cal_backend_weather_get_changes;
+ backend_class->is_loaded = e_cal_backend_weather_is_loaded;
+ backend_class->start_query = e_cal_backend_weather_start_query;
+ backend_class->get_mode = e_cal_backend_weather_get_mode;
+ backend_class->set_mode = e_cal_backend_weather_set_mode;
+
+ backend_class->internal_get_default_timezone = e_cal_backend_weather_internal_get_default_timezone;
+ backend_class->internal_get_timezone = e_cal_backend_weather_internal_get_timezone;
+}
+
+
+/**
+ * e_cal_backend_weather_get_type:
+ * @void:
+ *
+ * Registers the #ECalBackendWeather class if necessary, and returns
+ * the type ID associated to it.
+ *
+ * Return value: The type ID of the #ECalBackendWeather class.
+ **/
+GType
+e_cal_backend_weather_get_type (void)
+{
+ static GType e_cal_backend_weather_type = 0;
+
+ if (!e_cal_backend_weather_type) {
+ static GTypeInfo info = {
+ sizeof (ECalBackendWeatherClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) e_cal_backend_weather_class_init,
+ NULL, NULL,
+ sizeof (ECalBackendWeather),
+ 0,
+ (GInstanceInitFunc) e_cal_backend_weather_init
+ };
+ e_cal_backend_weather_type = g_type_register_static (E_TYPE_CAL_BACKEND_SYNC, "ECalBackendWeather", &info, 0);
+ }
+
+ return e_cal_backend_weather_type;
+}
diff --git a/calendar/backends/weather/e-cal-backend-weather.h b/calendar/backends/weather/e-cal-backend-weather.h
new file mode 100644
index 000000000..61fae8e86
--- /dev/null
+++ b/calendar/backends/weather/e-cal-backend-weather.h
@@ -0,0 +1,54 @@
+/* Evolution calendar - weather backend
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef E_CAL_BACKEND_WEATHER_H
+#define E_CAL_BACKEND_WEATHER_H
+
+#include <libedata-cal/e-cal-backend-sync.h>
+
+G_BEGIN_DECLS
+
+#define E_TYPE_CAL_BACKEND_WEATHER (e_cal_backend_weather_get_type ())
+#define E_CAL_BACKEND_WEATHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_CAL_BACKEND_WEATHER, ECalBackendWeather))
+#define E_CAL_BACKEND_WEATHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_CAL_BACKEND_WEATHER, ECalBackendWeatherClass))
+#define E_IS_CAL_BACKEND_WEATHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_CAL_BACKEND_WEATHER))
+#define E_IS_CAL_BACKEND_WEATHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_CAL_BACKEND_WEATHER))
+
+typedef struct _ECalBackendWeather ECalBackendWeather;
+typedef struct _ECalBackendWeatherClass ECalBackendWeatherClass;
+
+typedef struct _ECalBackendWeatherPrivate ECalBackendWeatherPrivate;
+
+struct _ECalBackendWeather {
+ ECalBackendSync backend;
+
+ /* Private data */
+ ECalBackendWeatherPrivate *priv;
+};
+
+struct _ECalBackendWeatherClass {
+ ECalBackendSyncClass parent_class;
+};
+
+GType e_cal_backend_weather_get_type (void);
+
+G_END_DECLS
+
+#endif
diff --git a/calendar/backends/weather/e-weather-source-ccf.c b/calendar/backends/weather/e-weather-source-ccf.c
new file mode 100644
index 000000000..756e2f8f9
--- /dev/null
+++ b/calendar/backends/weather/e-weather-source-ccf.c
@@ -0,0 +1,444 @@
+/* Evolution calendar - weather backend source class for parsing
+ * CCF (coded cities forecast) formatted NWS reports
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <libgnome/gnome-i18n.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include "e-weather-source-ccf.h"
+
+#define DATA_SIZE 5000
+
+static gchar *
+parse_for_url (char *code, char *name, xmlNode *parent)
+{
+ xmlNode *child;
+ if (parent->type == XML_ELEMENT_NODE) {
+ if (strcmp (parent->name, "location") == 0) {
+ child = parent->children;
+ g_assert (child->type == XML_TEXT_NODE);
+ if (strcmp (child->content, name) == 0) {
+ xmlAttr *attr;
+ gchar *url = NULL;
+ for (attr = parent->properties; attr; attr = attr->next) {
+ if (strcmp (attr->name, "code") == 0) {
+ if (strcmp (attr->children->content, code) != 0)
+ return NULL;
+ }
+ if (strcmp (attr->name, "url") == 0)
+ url = attr->children->content;
+ }
+ return g_strdup (url);
+ }
+ return NULL;
+ } else {
+ for (child = parent->children; child; child = child->next) {
+ gchar *url = parse_for_url (code, name, child);
+ if (url)
+ return url;
+ }
+ }
+ }
+ return NULL;
+}
+
+static void
+find_station_url (gchar *station, EWeatherSourceCCF *source)
+{
+ xmlDoc *doc;
+ xmlNode *root;
+ gchar **sstation;
+ gchar *url;
+
+ sstation = g_strsplit (station, "/", 2);
+
+ doc = xmlParseFile (WEATHER_DATADIR "/Locations.xml");
+ g_assert (doc != NULL);
+
+ root = xmlDocGetRootElement (doc);
+
+ url = parse_for_url (sstation[0], sstation[1], root);
+
+ source->url = g_strdup (url);
+ source->substation = g_strdup (sstation[0]);
+
+ g_strfreev (sstation);
+}
+
+EWeatherSource*
+e_weather_source_ccf_new (const char *uri)
+{
+ /* Our URI is formatted as weather://ccf/AAA[/BBB] - AAA is the 3-letter station
+ * code for identifying the providing station (subdirectory within the crh data
+ * repository). BBB is an optional additional station ID for the station within
+ * the CCF file. If not present, BBB is assumed to be the same station as AAA.
+ */
+ EWeatherSourceCCF *source = E_WEATHER_SOURCE_CCF (g_object_new (e_weather_source_ccf_get_type (), NULL));
+
+ find_station_url (strchr (uri, '/') + 1, source);
+ return E_WEATHER_SOURCE (source);
+}
+
+static GSList*
+tokenize (char *buffer)
+{
+ char *token;
+ char *tokbuf = g_strdup (buffer);
+ char *buffer2 = tokbuf;
+ GSList *ret;
+
+ token = strtok_r (buffer, " \n", &tokbuf);
+ ret = g_slist_append (NULL, g_strdup (token));
+ while ((token = strtok_r (NULL, " \n/", &tokbuf)))
+ ret = g_slist_append (ret, g_strdup (token));
+ g_free (buffer2);
+ return ret;
+}
+
+static void
+date2tm (char *date, struct tm *times)
+{
+ char tmp[3];
+ time_t curtime = time(NULL);
+ tmp[2] = '\0';
+
+ localtime_r (&curtime, times);
+
+ tmp[0] = date[0]; tmp[1] = date[1];
+ times->tm_mday = atoi(tmp);
+ tmp[0] = date[2]; tmp[1] = date[3];
+ times->tm_hour = atoi(tmp);
+ tmp[0] = date[4]; tmp[1] = date[5];
+ times->tm_min = atoi(tmp);
+}
+
+static WeatherConditions
+decodeConditions (char code)
+{
+ switch (code) {
+ case 'A': return WEATHER_FAIR;
+ case 'B': return WEATHER_PARTLY_CLOUDY;
+ case 'C': return WEATHER_CLOUDY;
+ case 'D': return WEATHER_DUST;
+ case 'E': return WEATHER_MOSTLY_CLOUDY;
+ case 'F': return WEATHER_FOGGY;
+ case 'G': return WEATHER_VERY_HOT_OR_HOT_HUMID;
+ case 'H': return WEATHER_HAZE;
+ case 'I': return WEATHER_VERY_COLD_WIND_CHILL;
+ case 'J': return WEATHER_SNOW_SHOWERS;
+ case 'K': return WEATHER_SMOKE;
+ case 'L': return WEATHER_DRIZZLE;
+ case 'M': return WEATHER_SNOW_SHOWERS;
+ case 'N': return WEATHER_WINDY;
+ case 'O': return WEATHER_RAIN_OR_SNOW_MIXED;
+ case 'P': return WEATHER_BLIZZARD;
+ case 'Q': return WEATHER_BLOWING_SNOW;
+ case 'R': return WEATHER_RAIN;
+ case 'S': return WEATHER_SNOW;
+ case 'T': return WEATHER_THUNDERSTORMS;
+ case 'U': return WEATHER_SUNNY;
+ case 'V': return WEATHER_CLEAR;
+ case 'W': return WEATHER_RAIN_SHOWERS;
+ case 'X': return WEATHER_SLEET;
+ case 'Y': return WEATHER_FREEZING_RAIN;
+ case 'Z': return WEATHER_FREEZING_DRIZZLE;
+ /* hmm, this should never happen. */
+ default: return WEATHER_SUNNY;
+ }
+}
+
+static int
+decodePOP (char data)
+{
+ int ret;
+
+ switch (data) {
+ case '-':
+ ret = 5;
+ break;
+ case '+':
+ ret = 95;
+ break;
+ case '/':
+ ret = -1; /* missing data */
+ break;
+ default:
+ ret = (data - '0') * 10;
+ }
+ return ret;
+}
+
+static void
+decodeSnowfall (char *data, float *low, float *high)
+{
+ char num[3];
+ num[2] = '\0';
+
+ num[0] = data[0]; num[1] = data[1];
+ *low = atof (num) * 2.54f;
+ num[0] = data[2]; num[1] = data[3];
+ *high = atof (num) * 2.54f;
+}
+
+static float
+ftoc (char *data)
+{
+ int fahrenheit = atoi(data);
+ if (fahrenheit >= 900)
+ fahrenheit = (fahrenheit - 900) * -1;
+ return ((float)(fahrenheit-32)) * 5.0f / 9.0f;
+}
+
+static void
+e_weather_source_ccf_do_parse (EWeatherSourceCCF *source, char *buffer)
+{
+ /* CCF gives us either 2 or 7 days of forecast data. IFPS WFO's
+ * will produce 7 day forecasts, whereas pre-IFPS WFO's are only
+ * mandated 2 (but may do 7). The morning forecast will give us either 2
+ * or 7 days worth of data. The evening forecast will give us the evening's
+ * low temperature plus 2 or 7 days forecast.
+ *
+ * The CCF format is described in NWS directive 10-503, but it's usually
+ * easier to look at a summary put up by one of the stations:
+ * http://www.crh.noaa.gov/lmk/product_guide/products/forecast/ccf.htm
+ */
+ WeatherForecast *forecasts = g_new0 (WeatherForecast, 7);
+ GSList *tokens = tokenize (buffer);
+ GSList *date;
+ GSList *current = tokens;
+ GList *fc = NULL;
+ struct tm tms;
+ int i;
+ time_t base;
+ gint n;
+
+ date = g_slist_nth (tokens, 3);
+ date2tm (date->data, &tms);
+
+ /* fast-forward to the particular station we're interested in */
+ current = g_slist_nth (tokens, 5);
+ while (strcmp(current->data, source->substation))
+ current = g_slist_next (current);
+ current = g_slist_next (current);
+ /* pick up the first two conditions reports */
+ forecasts[0].conditions = decodeConditions (((char*)(current->data))[0]);
+ forecasts[1].conditions = decodeConditions (((char*)(current->data))[1]);
+
+ current = g_slist_next (current);
+ if (tms.tm_hour < 12) {
+ for (i = 0; i < 2; i++) {
+ forecasts[i].high = ftoc (current->data);
+ current = g_slist_next (current);
+ forecasts[i].low = ftoc (current->data);
+ current = g_slist_next (current);
+ }
+ forecasts[2].high = ftoc (current->data);
+ current = g_slist_next (current);
+ forecasts[0].pop = decodePOP (((char*)(current->data))[2]);
+ forecasts[1].pop = decodePOP (((char*)(current->data))[4]);
+ } else {
+ for (i = 0; i < 2; i++) {
+ current = g_slist_next (current);
+ forecasts[i].high = ftoc (current->data);
+ current = g_slist_next (current);
+ forecasts[i].low = ftoc (current->data);
+ }
+ current = g_slist_next (current);
+ forecasts[0].pop = decodePOP (((char*)(current->data))[1]);
+ forecasts[1].pop = decodePOP (((char*)(current->data))[3]);
+ }
+
+ current = g_slist_next (current);
+ if (strlen (current->data) == 4) {
+ /* we've got the optional snowfall field */
+ if (tms.tm_hour < 12) {
+ decodeSnowfall (current->data, &forecasts[0].low, &forecasts[0].high);
+ current = g_slist_next (g_slist_next (current));
+ decodeSnowfall (current->data, &forecasts[1].low, &forecasts[1].high);
+ } else {
+ current = g_slist_next (current);
+ decodeSnowfall (current->data, &forecasts[0].low, &forecasts[0].high);
+ }
+ current = g_slist_next (current);
+ }
+
+ /* set dates */
+ base = mktime (&tms);
+ if (tms.tm_hour >= 12)
+ base += 43200;
+ for (i = 0; i < 7; i++)
+ forecasts[i].date = base + 86400*i;
+
+ if (current == NULL || strlen (current->data) == 3) {
+ /* We've got a pre-IFPS station. Realloc and return */
+ WeatherForecast *f = g_new0(WeatherForecast, 2);
+ memcpy (f, forecasts, sizeof (WeatherForecast) * 2);
+ fc = g_list_append (fc, &f[0]);
+ fc = g_list_append (fc, &f[1]);
+ source->done (fc, source->finished_data);
+ }
+
+ /* Grab the conditions for the next 5 days */
+ forecasts[2].conditions = decodeConditions (((char*)(current->data))[0]);
+ forecasts[3].conditions = decodeConditions (((char*)(current->data))[1]);
+ forecasts[4].conditions = decodeConditions (((char*)(current->data))[2]);
+ forecasts[5].conditions = decodeConditions (((char*)(current->data))[3]);
+ forecasts[6].conditions = decodeConditions (((char*)(current->data))[4]);
+
+ /* Temperature forecasts */
+ current = g_slist_next (current);
+ if (tms.tm_hour < 12) {
+ forecasts[2].low = ftoc (current->data);
+ for (i = 3; i < 6; i++) {
+ current = g_slist_next (current);
+ forecasts[i].high = ftoc (current->data);
+ current = g_slist_next (current);
+ forecasts[i].low = ftoc (current->data);
+ }
+ current = g_slist_next (current);
+ forecasts[6].high = ftoc (current->data);
+ forecasts[6].low = forecasts[6].high;
+ current = g_slist_next (current);
+ forecasts[2].pop = decodePOP (((char*)(current->data))[1]);
+ forecasts[3].pop = decodePOP (((char*)(current->data))[3]);
+ forecasts[4].pop = decodePOP (((char*)(current->data))[5]);
+ forecasts[5].pop = decodePOP (((char*)(current->data))[7]);
+ forecasts[6].pop = decodePOP (((char*)(current->data))[9]);
+ n = 7;
+ } else {
+ for (i = 2; i < 6; i++) {
+ forecasts[i].high = ftoc (current->data);
+ current = g_slist_next (current);
+ forecasts[i].low = ftoc (current->data);
+ current = g_slist_next (current);
+ }
+ n = 6;
+ /* hack for people who put out bad data, like Pueblo, CO. Yes, PUB, that means you */
+ if (strlen (current->data) == 3)
+ current = g_slist_next (current);
+ forecasts[1].pop = decodePOP (((char*)(current->data))[0]);
+ forecasts[2].pop = decodePOP (((char*)(current->data))[2]);
+ forecasts[3].pop = decodePOP (((char*)(current->data))[4]);
+ forecasts[4].pop = decodePOP (((char*)(current->data))[6]);
+ forecasts[5].pop = decodePOP (((char*)(current->data))[8]);
+ }
+
+ for (i = 0; i < n; i++) {
+ fc = g_list_append (fc, &forecasts[i]);
+ }
+ source->done (fc, source->finished_data);
+
+ g_free (forecasts);
+ g_list_free (fc);
+}
+
+static void
+retrieval_done (SoupMessage *message, EWeatherSourceCCF *source)
+{
+ char *str;
+ const char *newuri;
+
+ /* Handle redirection ourselves */
+ if (SOUP_STATUS_IS_REDIRECTION (message->status_code)) {
+ newuri = soup_message_get_header (message->response_headers, "Location");
+
+ if (newuri) {
+ SoupMessage *soup_message;
+ soup_message = soup_message_new (SOUP_METHOD_GET, newuri);
+ soup_message_set_flags (soup_message, SOUP_MESSAGE_NO_REDIRECT);
+ soup_session_queue_message (source->soup_session, soup_message, (SoupMessageCallbackFn) retrieval_done, source);
+ return;
+ } else {
+ source->done (NULL, source->finished_data);
+ }
+
+ return;
+ }
+
+ /* check status code */
+ if (!SOUP_STATUS_IS_SUCCESSFUL (message->status_code)) {
+ source->done (NULL, source->finished_data);
+ return;
+ }
+
+ str = g_malloc0 (message->response.length + 1);
+ strncpy (str, message->response.body, message->response.length);
+ e_weather_source_ccf_do_parse (source, str);
+ g_free (str);
+}
+
+static void
+e_weather_source_ccf_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data)
+{
+ EWeatherSourceCCF *ccfsource = (EWeatherSourceCCF*) source;
+ SoupMessage *soup_message;
+
+ ccfsource->finished_data = data;
+
+ ccfsource->done = done;
+
+ if (!ccfsource->soup_session)
+ ccfsource->soup_session = soup_session_async_new ();
+ soup_message = soup_message_new (SOUP_METHOD_GET, ccfsource->url);
+ soup_message_set_flags (soup_message, SOUP_MESSAGE_NO_REDIRECT);
+ soup_session_queue_message (ccfsource->soup_session, soup_message, (SoupMessageCallbackFn) retrieval_done, source);
+}
+
+static void
+e_weather_source_ccf_class_init (EWeatherSourceCCFClass *class)
+{
+ EWeatherSourceClass *source_class;
+
+ source_class = (EWeatherSourceClass *) class;
+
+ source_class->parse = e_weather_source_ccf_parse;
+}
+
+static void
+e_weather_source_ccf_init (EWeatherSourceCCF *source)
+{
+ source->url = NULL;
+ source->substation = NULL;
+ source->soup_session = NULL;
+}
+
+GType
+e_weather_source_ccf_get_type (void)
+{
+ static GType e_weather_source_ccf_type = 0;
+
+ if (!e_weather_source_ccf_type) {
+ static GTypeInfo info = {
+ sizeof (EWeatherSourceCCFClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) e_weather_source_ccf_class_init,
+ NULL, NULL,
+ sizeof (EWeatherSourceCCF),
+ 0,
+ (GInstanceInitFunc) e_weather_source_ccf_init
+ };
+ e_weather_source_ccf_type = g_type_register_static (E_TYPE_WEATHER_SOURCE, "EWeatherSourceCCF", &info, 0);
+ }
+
+ return e_weather_source_ccf_type;
+}
diff --git a/calendar/backends/weather/e-weather-source-ccf.h b/calendar/backends/weather/e-weather-source-ccf.h
new file mode 100644
index 000000000..524351cfd
--- /dev/null
+++ b/calendar/backends/weather/e-weather-source-ccf.h
@@ -0,0 +1,59 @@
+/* Evolution calendar - weather backend source class for parsing
+ * CCF (coded cities forecast) formatted NWS reports
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef E_WEATHER_SOURCE_CCF_H
+#define E_WEATHER_SOURCE_CCF_H
+
+#include <libsoup/soup-session-async.h>
+#include <libsoup/soup-uri.h>
+#include "e-weather-source.h"
+
+G_BEGIN_DECLS
+
+#define E_TYPE_WEATHER_SOURCE_CCF (e_weather_source_ccf_get_type ())
+#define E_WEATHER_SOURCE_CCF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
+#define E_WEATHER_SOURCE_CCF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
+#define E_IS_WEATHER_SOURCE_CCF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_WEATHER_SOURCE_CCF))
+#define E_IS_WEATHER_SOURCE_CCF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_WEATHER_SOURCE_CCF))
+
+typedef struct _EWeatherSourceCCF EWeatherSourceCCF;
+typedef struct _EWeatherSourceCCFClass EWeatherSourceCCFClass;
+
+struct _EWeatherSourceCCF {
+ EWeatherSource parent;
+
+ char *url;
+ char *substation;
+ EWeatherSourceFinished done;
+ SoupSession *soup_session;
+ gpointer finished_data;
+};
+
+struct _EWeatherSourceCCFClass {
+ EWeatherSourceClass parent_class;
+};
+
+EWeatherSource* e_weather_source_ccf_new (const char *uri);
+GType e_weather_source_ccf_get_type (void);
+
+G_END_DECLS
+
+#endif
diff --git a/calendar/backends/weather/e-weather-source.c b/calendar/backends/weather/e-weather-source.c
new file mode 100644
index 000000000..c7aecdf59
--- /dev/null
+++ b/calendar/backends/weather/e-weather-source.c
@@ -0,0 +1,73 @@
+/* Evolution calendar - weather backend source class
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "e-weather-source.h"
+#include "e-weather-source-ccf.h"
+
+void
+e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data)
+{
+ EWeatherSourceClass *class;
+ g_return_if_fail (source != NULL);
+ class = (EWeatherSourceClass*) G_OBJECT_GET_CLASS (source);
+ return class->parse (source, done, data);
+}
+
+static void
+e_weather_source_class_init (EWeatherSourceClass *class)
+{
+ /* nothing to do here */
+}
+
+static void
+e_weather_source_init (EWeatherSource *source)
+{
+ /* nothing to do here */
+}
+
+GType
+e_weather_source_get_type (void)
+{
+ static GType e_weather_source_type = 0;
+
+ if (!e_weather_source_type) {
+ static GTypeInfo info = {
+ sizeof (EWeatherSourceClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) e_weather_source_class_init,
+ NULL, NULL,
+ sizeof (EWeatherSource),
+ 0,
+ (GInstanceInitFunc) e_weather_source_init
+ };
+ e_weather_source_type = g_type_register_static (G_TYPE_OBJECT, "EWeatherSource", &info, 0);
+ }
+
+ return e_weather_source_type;
+}
+
+EWeatherSource* e_weather_source_new (const char *uri)
+{
+ char *base = uri + 10; /* skip weather:// */
+ if (strncmp (base, "ccf/", 4) == 0)
+ return e_weather_source_ccf_new (base);
+ return NULL;
+}
diff --git a/calendar/backends/weather/e-weather-source.h b/calendar/backends/weather/e-weather-source.h
new file mode 100644
index 000000000..dd67c6d51
--- /dev/null
+++ b/calendar/backends/weather/e-weather-source.h
@@ -0,0 +1,103 @@
+/* Evolution calendar - weather backend source class
+ *
+ * Copyright (C) 2005 Novell, Inc (www.novell.com)
+ *
+ * Authors: David Trowbridge <trowbrds@cs.colorado.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef E_WEATHER_SOURCE_H
+#define E_WEATHER_SOURCE_H
+
+#include <glib-object.h>
+#include <time.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+ WEATHER_FAIR,
+ WEATHER_SNOW_SHOWERS,
+ WEATHER_SNOW,
+ WEATHER_PARTLY_CLOUDY,
+ WEATHER_SMOKE,
+ WEATHER_THUNDERSTORMS,
+ WEATHER_CLOUDY,
+ WEATHER_DRIZZLE,
+ WEATHER_SUNNY,
+ WEATHER_DUST,
+ WEATHER_CLEAR,
+ WEATHER_MOSTLY_CLOUDY,
+ WEATHER_WINDY,
+ WEATHER_RAIN_SHOWERS,
+ WEATHER_FOGGY,
+ WEATHER_RAIN_OR_SNOW_MIXED,
+ WEATHER_SLEET,
+ WEATHER_VERY_HOT_OR_HOT_HUMID,
+ WEATHER_BLIZZARD,
+ WEATHER_FREEZING_RAIN,
+ WEATHER_HAZE,
+ WEATHER_BLOWING_SNOW,
+ WEATHER_FREEZING_DRIZZLE,
+ WEATHER_VERY_COLD_WIND_CHILL,
+ WEATHER_RAIN,
+} WeatherConditions;
+
+typedef struct {
+ /* date, in UTC */
+ time_t date;
+ /* expected conditions */
+ WeatherConditions conditions;
+ /* internal storage is always in celcius and should be
+ * converted based on the user's current locale setting */
+ float high, low;
+ /* probability of precipitation */
+ int pop;
+ /* snowfall forecast - internal storage in cm */
+ float snowhigh, snowlow;
+} WeatherForecast;
+
+typedef void (*EWeatherSourceFinished)(GList *results, gpointer data);
+
+#define E_TYPE_WEATHER_SOURCE (e_weather_source_get_type ())
+#define E_WEATHER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_WEATHER_SOURCE, EWeatherSource))
+#define E_WEATHER_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_WEATHER_SOURCE, EWeatherSource))
+#define E_IS_WEATHER_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_WEATHER_SOURCE))
+#define E_IS_WEATHER_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_WEATHER_SOURCE))
+
+typedef struct _EWeatherSource EWeatherSource;
+typedef struct _EWeatherSourceClass EWeatherSourceClass;
+
+/* This class is an abstract base-class for any weather data source.
+ * All the URL fetching is handled outside of this, and all this has
+ * to know how to do is parse the specific format. */
+struct _EWeatherSource {
+ GObject object;
+};
+
+struct _EWeatherSourceClass {
+ GObjectClass parent_class;
+
+ /* Returns a list of WeatherForecast objects containing the
+ * data for the forecast. */
+ void (*parse) (EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
+};
+
+EWeatherSource* e_weather_source_new (const char *uri);
+GType e_weather_source_get_type (void);
+void e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
+
+G_END_DECLS
+
+#endif