I delve into how Apple gets some of its info for its widgets. Read more to find out.
Apple gets a bunch of its widget info via xml (duh…) from a couple of different sources. First off, the weather widget gets its data from apple.accuweather.com like so:
http://apple.accuweather.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=Norman,%20OK
or
http://apple.accuweather.com/adcbin/apple/Apple_Weather_Data.asp?zipcode=73069
It does that nifty little city autofill thing by sending a request like so:
http://apple.accuweather.com/adcbin/apple/Apple_find_city.asp?location=Norman
and gets this back:
<?xml version="1.0"?>
<adc_Database>
<CityList us="12" intl="49" extra_cities="1">
<location city="Norman" state="AR" postal="71960"/>
<location city="Norman" state="IN" postal="47264"/>
<location city="Norman" state="NC" postal="28367"/>
<location city="Norman" state="NE" postal="68963"/>
<location city="Norman" state="OK" postal="73019"/>
</CityList>
<Copyright> Copyright AccuWeather.com</Copyright>
<Use> Apple Widget</Use>
<Redistribution> Redistribution Prohibited.</Redistribution>
</adc_Database>
(I took a couple out of the list).
Anyway, so then the weather widget just updates a little list based on that. I might write a cocoa class that accesses all of this stuff using this API (if you can call it that).
Comments are closed.