Monday, October 21, 2013

SPOT tracker API update

I've been noticing a fair amount of activity on my write-your-own-tracker post and I thought I ought to give a heads-up that there have been changes to the SPOT API, some rather major.  For the most part these seem to have been implemented to accommodate the new SPOT 3 and the updated services.  Without having dinked with it, the API described in my old post has apparently been deprecated and is no longer available (or may not be available in the future).  There's a new URI to retrieve the data.  Definitely rely on the information in the SPOT API web page, not my previous post, for what you'll need to be able to parse the SPOT messages.

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.

Wednesday, October 16, 2013

A listing of which mushers are running which races

We were sitting around the other day, wondering which races various mushers were doing, and it occurred to me that it would be very easy to throw together a list of which mushers are doing which races.  So, I did.  It was basically a cut-and-paste job, using a Google Drive spreadsheet.

I think a lot of people are using spreadsheets only to store data as tables and might not be aware of what kind of data munging, both simple and complex, is available.  In this case I basically just cut and paste race rosters, and then sorted by musher name, using this:



As you can see, under the "Data" menu item there's an option to sort the spreadsheet by a column.  With your mouse, select the column you'd like to sort by (in our case, column A contains the musher names), and it will show up in the menu.  Handy, dandy, and awfully easy.

The spreadsheet is available here.  Let me know if you have questions, comments, or have spotted an error that needs fixing.  I'll be adding races as their rosters come online.

Saturday, October 5, 2013

Race calendar

This year I'm planning on providing more tools and less whining analysis.  Here's an easy one that may or may not be useful.  Because I have to travel for work fairly often I'm trying to get a handle on my schedule this winter, so I've thrown together a calendar of distance mushing events in Alaska on Google Calendar, and since I'm not the only person interested in these things I've made it public.  Here's how to add it to your own calendar on Google.

First, log into Google Calendar from your web browser.  On the left-hand side of the page you'll see "My calendars" and "Other calendars".




If you click the triangle-in-a-box immediately to the right of "Other calendars" you'll get a drop-down menu, like this:




Choose "Add by URL".  This will pop a small dialogue box.  In the text field, paste in (and seriously, copy and paste this rather than typing by hand) "https://www.google.com/calendar/ical/fvidsm2c61mn3tr7106d9kk4ao%40group.calendar.google.com/public/basic.ics" (without the quotes) and click "Add calendar".


That's it!  Piece of cake.  The calendar is for Alaska distance mushing events.  I'm sure I've missed some and gotten others wrong, so let me know what's missing or needs to be corrected.

Here's looking forward to another great season of dogsled racing!