Mother and Latitude

5 views
Skip to first unread message

fbeek

unread,
Feb 22, 2012, 9:52:05 AM2/22/12
to LVL1 - Louisville's Hackerspace
Hi Guys,

my name is Florian, I am a student from Mülheim in Germany.
I saw the article about MOTHER at HackaDay and found it awesome.

I am working on a similar system for my home and would ask how you
managed it that MOTHER could get the positions of your members over
Google Latitude.

My home Bot "Alice" has its own Google Account and my girlfriend and i
are connected to her but i can't find any starting point to get the
positions out of Alice account over the Google Api.

Can someone of you please give me a hind?

Regards

Florian

Jonathan Clark

unread,
Feb 22, 2012, 11:03:27 AM2/22/12
to lv...@googlegroups.com
Hey Florian,
I'd be more then happy to give you some information about the Latitude integration. As a side note, I'm working on getting as much information as I can documented on the MOTHER wiki.  Also keep in mind we are currently using some non-opensource software that helps ease the integration of various systems, but we have started creating a completely open source solution for automation that will make things like latitude integration as simple as possible.  ( www.holosworld.com )

Now on to the latitude integration details. I started out the same way you are trying now with creating a google account for MOTHER and then trying to connect with everyone else's accounts and realized there was a much simpler solution that would work just as well.  Latitude accounts now have a feature called a "public badge".  This badge is a way for anyone to share their latitude location publicly from websites or external applications. Just to be clear, this DOESN'T allow just anyone to be able to view your location, it's more like having an api key that you can use in applications to pull the data.  So here's how you do it:

1. You have to turn on the public badge feature for your account.  You can do that with this link which will then provide you with a snippet of code.  In this code you should see your user id.  You need to copy that for use in the next step.  
https://www.google.com/latitude/b/0/apps 

2. You can now use the latitude api to access your location.  The easiest way (or at least the way I'm currently doing this) is by writing some code that performs a "http get" to a url that returns an XML file with you last location details.  Here's the url that I use to get the information. This is will return my latest google location information.  You can replace my user id with the one you copied before to see your own information.


3.  In whatever language your working with you'll need to then parse the xml data and save whatever information you need (primarily your lat and long).  From there it's up to you what you do with that information.  The code I'm using now has the lat and long of specific locations, like our hackerspace, certain hardware stores, and other related locations.  The code then takes care of performing the calculations needed to determine the distance between each member and each location.  Other scripts handle what to do when a specific member is within a certain distance of a specific location.  

I hope this helps you and please feel free to ask more questions if you get stuck, and  let me know how it goes.  It's awesome to other makers interested in automation.  

fbeek

unread,
Feb 23, 2012, 3:30:33 PM2/23/12
to LVL1 - Louisville's Hackerspace
Hi,
wow ,thanks that is much more informations as I had expected.
Your way is much easier than the way over the OAuth authentication
service.

Today I tried succesfully an OAuth Python example from Google.
If you are interested, I would send you the working example. It is
very simple, I found it at the Google code and it works with an
persistent token storage in a file.

You start the OAuth process,than it gives you a link to authenticate
and grand the rights to your app. After that it stores the access
token in a storage file and prints out your location.



On 22 Feb., 17:03, Jonathan Clark <jdc...@gmail.com> wrote:
> Hey Florian,
> I'd be more then happy to give you some information about the Latitude
> integration. As a side note, I'm working on getting as much information as
> I can documented on the MOTHER wiki.  Also keep in mind we are currently
> using some non-opensource software that helps ease the integration of
> various systems, but we have started creating a completely open source
> solution for automation that will make things like latitude integration as
> simple as possible.  (www.holosworld.com)
>
> Now on to the latitude integration details. I started out the same way you
> are trying now with creating a google account for MOTHER and then trying to
> connect with everyone else's accounts and realized there was a much simpler
> solution that would work just as well.  Latitude accounts now have a
> feature called a "public badge".  This badge is a way for anyone to share
> their latitude location publicly from websites or external applications.
> Just to be clear, this DOESN'T allow just anyone to be able to view your
> location, it's more like having an api key that you can use in applications
> to pull the data.  So here's how you do it:
>
> 1. You have to turn on the public badge feature for your account.  You can
> do that with this link which will then provide you with a snippet of code.
>  In this code you should see your user id.  You need to copy that for use
> in the next step.https://www.google.com/latitude/b/0/apps
>
> 2. You can now use the latitude api to access your location.  The easiest
> way (or at least the way I'm currently doing this) is by writing some code
> that performs a "http get" to a url that returns an XML file with you last
> location details.  Here's the url that I use to get the information. This
> is will return my latest google location information.  You can replace my
> user id with the one you copied before to see your own information.http://www.google.com/latitude/apps/badge/api?user=458289239703344775...
Reply all
Reply to author
Forward
0 new messages