Not that you’d really notice, but I’ve updated the code to show my current location on the map on this blog to use Fire Eagle to store my current location.
If you haven’t heard of it before, Fire Eagle is a service provided by Yahoo! which lets you store your current location, and then allow different applications read or write access that location at an accuracy level that you control.
This is a simple service which is actually really cool, and there are already multiple applications on different platforms (web, client and mobile) which allow you to read and/or update your location dynamically. So if you really want to – and I do! – you can track and expose your location however you want.
The full developer details are at http://fireeagle.yahoo.net/developer (you need a Yahoo! account to access this) so I won’t explain too many of the low-level details here. However here’s a few things to note if you want to investigate yourself:
1. Fire Eagle uses OAuth for securing access to their API, which means:
2. There are various libraries available for both OAuth and Fire Eagle access:
Once all of the access token details have been obtained and stored in my web.config file (I know, not the most secure practice and not one I’d use on a real production site), then using the C# library it’s very easy to get my location with a few lines of code:
Token userToken = new Token(appSettings["fireeagle_usertoken"], appSettings["fireeagle_usersecret"]); FireEagle fireEagle = new FireEagle(appSettings["fireeagle_consumertoken"], appSettings["fireeagle_consumersecret"], userToken); User fireEagleUser = fireEagle.User(); Location bestLocation = fireEagleUser.LocationHierarchy.BestGuess;
I can then use that Location object (after my extension to the library) to get the latitude and longitude to drive my JavaScript implementation of Virtual Earth shown in an earlier post.
As an aside – which I may come back to in a future post – I wanted to protect some of the pages I built (the ones where I expose my Fire Eagle token details). To do this I used Windows Live ID using code from the Web Authentication SDK – see http://dev.live.com/liveid/ for details.
This was almost trivially easy, and having banged my head against earlier Passport implementations, this was a pleasure to use (if that’s not overstating things!). Kudos to the Live ID team, and if you’ve been put off using WLID after being scarred by previous attempts with Passport, I definitely recommend taking another look.