From the description of the updated API:
Battery State will be sent along with most message types, not every message will have it, but most of them will. It has two states. Examples:
<batteryState>GOOD</batteryState>
<batteryState>LOW</batteryState>
ModelID will also appear in the XML. Values:
<modelId>SPOT3</modelId>
<modelId>SPOT2</modelId>
<modelId>SPOT-2-IS</modelId>
<modelId>SPOT</modelId>
<modelId>SPOTCONNECT</modelId>
<modelId>SPOTDC</modelId>
<modelId>HUG</modelId>
Three new message types as well.
<messageType>NEWMOVEMENT</messageType>
<messageType>UNLIMITED-TRACK</messageType>
<messageType>EXTREME-TRACK</messageType>
The new message types are undocumented, unfortunately, and may take some experimentation to sort out (they're clearly related to the SPOT 3). What they're not telling you and also appears to be undocumented is that the overall format of the feed has changed, being no longer a messageList. It is now a response and contains new elements, including a feedMessageResponse which itself contains a feed element with metadata describing the device and service, and the messages themselves. Note that the messageList element is now called messages and that it's deeper in the tree. There's also a new element tagged hidden in the message (no, I have no idea, either).
I should add that if I were coding this up today I'd use the JSON-formatted response, both for ease of parsing and for efficiency.
So basically, while the old post may still be useful for examples of how to parse XML in Javascript, how to do some basic things with the Google Maps API, etc., the URI needs to change to accommodate the updated API, and the XML (or JSON!) parsing will need to be tweaked.
I should add that if I were coding this up today I'd use the JSON-formatted response, both for ease of parsing and for efficiency.
So basically, while the old post may still be useful for examples of how to parse XML in Javascript, how to do some basic things with the Google Maps API, etc., the URI needs to change to accommodate the updated API, and the XML (or JSON!) parsing will need to be tweaked.
No comments:
Post a Comment