harmless weather hacking

Feb 19, 2009 00:37


Albeit working just for the U.S. (or in some profiles, North American) territory, AccuWeather.com does provide awesome service. Really. In more ways than just one.

Take this nice feature for example. See for yourself: they have what they call an "enhanced" radar (currently in beta stage), which is greatly hackable. The animated radar image is implemented with multiple images and JavaScript, and each frame is loaded separately. The URLs to each frame look kind of like this:

http://nmigsadc.accuweather.com/WIGS/DrawWeatherMap.aspx?imageSource=US_SIR&geoWidth=1200&geoUnit=km&imageWidth=1024&imageHeight=768&imageFormat=atPNG&branding= (C) 2009 AccuWeather.com&uZipCode=31709&uLabel=you are here&mx=-84&my=32&ids=US2:0902190430&dataLayerVis=110001101111111111

Whoa... what is all that stuff? Let's see.
  • imageSource. Doesn't seem to do a whole lot, but let's leave it just in case something changes in the future; it changes for different data sources (see ids parameter below) in the original page
  • geoWidth. This is the width of the map in units specified in the next parameter. By increasing this value you can zoom out; conversely, lesser values zoom in (resolution of their default radar is still pretty low, so it won't help much if you zoom in to a couple kilometers; hi-res is a little more interesting, but at some point it really stops making sense).
  • geoUnit. Geographical unit, I assume: what units to measure real distances in: can be either mi or km (anything else is treated like mi).
  • imageWidth and imageHeight. Well, this is obvious - pixel size of the image
  • imageFormat. Haven't messed with this one, but PNG is good'nuff for me.
  • branding. Specifies text to put in the bottom left corner; in this case, a copyright statement.
  • uZipCode. This is just for the marker for your location. Enter any ZIP code and the marker will move to that location (invalid ZIPs will not display anything).
  • uLabel. Label for the location marker; if not specified or empty, prints the ZIP code
  • mx and my. These are the geographic coordinates of the center of the screen. Theoretically, you can specify any location on the Earth (a nice list of locations can be found, for example, on Tageo.com), but the weather info only works within the U.S.
  • ids. The ID of the frame. Basically, it's a timestamp (looks pretty GMT), at 15-minute intervals in the format of YYMMDDhhmm. US2 specifies the source. Different sources may have different times for snapshots:
    • UC1: N. America Enhanced Radar (snapshots at :00, :15, :30, :45)
    • UC2: N. America Visible Radar (snapshots at :00, :15, :30, :45)
    • US2 (specified in the URL): U.S. Snow/Ice/Rain radar (snapshots at :00, :15, :30, :45)
    • US3: U.S. Hi-Resolution radar (beta) (snapshots at :58, :13, :28, :43)
    • CC1: Current conditions icons (snapshots at :59, :14, :29, :44)
    • AL1: Alaska Radar (snapshots at :00, :15, :30, :45)
    • HI1: Hawaii Radar (snapshots at :00, :15, :30, :45)
    • CN2: Canada Snow/Ice/Rain radar (snapshots at :00, :15, :30, :45)
  • dataLayerVis. This one deserves a list of its own. Each 1 or 0 specifies a flag causing a particular detail to be shown (1) or hidden (0). I'll start from the leftmost and move to the right:
    1. Water (if not displayed, water is painted green like land)
    2. County borders
    3. State borders (these are a bit bolder)
    4. Medium-sized towns (there are lots of them, so it makes sense to hide them on a bigger map)
    5. Big towns
    6. Cities
    7. Major highways
    8. Major highway labels/numbers
    9. Marker "you are here" with the ZIP code (see uZipCode and uLabel parameters)
    10. Timestamp in the top right corner
    11. Branding in the bottom left corner (see branding parameter)
    12. (doesn't seem to make any difference by itself; maybe some auxiliary setting)
    13. (again, no visible effects)
    14. Radar data. Duh, you don't want to just stare at the map, do you? :)
    15. Radar information in the bottom right corner
    16. Terrain elevation
    17. (doesn't seem to make any difference by itself; perhaps an auxiliary or reserved flag)
    18. (doesn't seem to make any difference by itself; perhaps an auxiliary or reserved flag)

  • That's it for now. Happy hacking! ☺

    X-SMALL PRINT: Of course, like everything else, this interface is bound to change, and since the website is not mine, I cannot notify anybody of that. Use at your own risk. Also, unauthorized access to these features may violate their ToS and even lead to a legal action. Take it for what it's worth.

программизм

Previous post Next post
Up