Spot Messenger API

The Spot Messenger is a neat bit of gear. My 18-year-old daughter just got back from a 10-day trip down through OR, ID, MT, UT, and CO with her friend, and my wife and I wanted a way to keep an eye on where she was, and an awful lot of their trip was going to be in places with zero cell service.  I had a Spot messenger sitting in a drawer in my office, so I dug it out, put some batteries in it, and re-subscribed to the service. It’s easy to see where the thing is using their web page, or even better, via their free iPhone app.  After a few days, I started to wonder if Spot had a public API available to pull data from (it’s a lot easier than trying to do web-scraping).  In fact, they do, though there’s almost zero in the way of documentation, and what little there is kind of gives you the idea that some intern has a task to support it in his spare time.  Fortunately, it worked exactly the way it should have, and a very small amount of code lets you poll the API to get position data back (see below).  The code was written using SBCL and Quicklisp on Linux, though it should work on any modern CL that’s supported by Quicklisp (which is essentially all of them). I tried it on my Mac, and it worked perfectly.  You’ll need to fill in the glld (which is the unique Feed Identifier assigned by Spot when you share a page) as well as the optional password. If there’s no password, just set *feedpassword* to nil (no quotes).  By default, the up-to-dater thread polls the Spot API every 2.5 minutes. If you do it more often, you’ll anger the API Gods, and Spot will cut you off. A 30 second interval on checking *locations* for new data seems to work well, though you can change this with *sleeptime*.  Load the code, then do (start-spot) to start the background thread that polls the API and keeps *locations* up to date with current location data. If you want to watch the location data as it streams in (“streams” might be a strong word, as by default, the tracking is only updated every ten minutes), do (watch-spots).  That’s it. Obviously, there’s a lot you can do with the location objects other than just look at them, but this is enough to get you started. Unfortunately, WordPress eats much of the indentation when I pasted in the code, so it’s a little hard to read. But copy and paste this into your editor, save it, run it, and you should be fine.  I decided to just stick the code in github, instead of leaving potentially outdated code posted here.  So go look here for the latest version (I already added reverse geocoding to the original code).

 

Advertisements

One thought on “Spot Messenger API

  1. Hey Jeff-

    Nice to hear about your progress. Hope all is well in your life. 🙂

    Well, it may be no surprise to you that I am working on a cool new aviation-based idea. I am trying to get the word out to pilots and I’d love to get your feedback. Of course I also hope you will share it with others!!

    I recently spent some time at beautiful Lake Roosevelt and fell in love with the place. Prettiest area of our state, I think, for outdoor recreation. And, I happened to stumble across an airport for sale! 🙂

    I am wanting to get word out to fellow pilots about this great opportunity to own a piece of an amazing airport in a fractional ownership program I am putting together for Coulee City Airport, at the gateway to some of our most beautiful countryside.

    Take a look at the attached proposal and let me know what you think. And, of course, please pass this on to everyone you can think of. I really think it is a special opportunity that many pilots would be interested in!

    Thanks Jeff!

    I need to scoot this along pretty quickly to make it happen, so I hope to hear back from you soon!

    Best regards,

    *Cate*

    Cate Schultz (Mighell) 425.870.6335 cjmighell@gmail.com

    On Mon, Jul 18, 2016 at 11:20 AM, Jeff Builds a Plane wrote:

    > Jeff posted: “The Spot Messenger is a neat bit of gear. My 18-year-old > daughter just got back from a 10-day trip down through OR, ID, MT, UT, and > CO with her friend, and my wife and I wanted a way to keep an eye on where > she was, and an awful lot of their trip was goin” >

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s