Page 1 of 1

Find My iDevices -- Next Step Poll

PostPosted: Wed Aug 10, 2011 12:30 pm
by bschollnick2
The Current Find My iDevice, uses the MobileMe service, exclusively...

Do you think that Google Latitude would be a useful alternative, the major obvious benefit, is that this could be used to support the display of non-iDevices...

What do you think?

Re: Find My iDevices -- Next Step Poll

PostPosted: Tue Dec 20, 2011 8:18 am
by nlagaros
I used Google Latitude to convert coordinates for each iPhone I track to a physical address. It was just a few lines of code to address their API. I think it would be a simple and useful addition to the plugin.

Re: Find My iDevices -- Next Step Poll

PostPosted: Tue Dec 20, 2011 7:07 pm
by bschollnick2
nlagaros wrote:
I used Google Latitude to convert coordinates for each iPhone I track to a physical address. It was just a few lines of code to address their API. I think it would be a simple and useful addition to the plugin.


Feel like posting an example? It certainly would be a useful addition....

Re: Find My iDevices -- Next Step Poll

PostPosted: Wed Dec 21, 2011 7:17 am
by nlagaros
I have a variable iPhone_xxx that is populated with the full address from querying Google Latitude. Code below:

Code: Select all
import urllib2
from xml.etree import ElementTree as ET

dev = indigo.devices["iPhone - xxx"]
latitude = str(dev.states["Latitude"])
longitude = str(dev.states["Longitude"])

theUrl = u"http://maps.googleapis.com/maps/api/geocode/xml?latlng=" + latitude+ "," + longitude + "&sensor=false"


f = urllib2.urlopen(theUrl)
theXML = f.read()

GEO = ET.parse(urllib2.urlopen(theUrl))
GEO_results = GEO.find('result')
FA = GEO_results.findtext('formatted_address')

indigo.variable.updateValue("iPhone_xxx", FA)