Top Banner
Tracking large metallic objects using App Engine and Latitude Kelvin Nicholson
13

Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Jul 09, 2015

Download

Technology

In this presentation I give an overview of hacking Google Latitude and Google App Engine to track "friends".
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Tracking large metallic objects using App Engine and Latitude

Kelvin Nicholson

Page 2: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Creative Opportunities Abound

Page 3: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine
Page 4: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Python

Page 5: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

An idea is born

+ +

Page 6: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

General Workflow

HTTP Post over 3G

Parse POST Data (XML)

Verify Location in NSW

Get OAuth Credentials for “user”

Post Location to Latitude API

Page 7: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

General Workflow 2

class RawXml(db.Model): # storage model for raw GPS data

content = db.TextProperty()

class MainHandler(webapp.RequestHandler): # do stuff

def get(self):

self.response.out.write('OK')

def post(self):

content = self.request.body

rawXmlObject = RawXml(content = str(content))

rawXmlObject.put()

Page 8: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

General Workflow 2

<gpsid=“metalObject"><coordinates><coordinate><fix>3D</fix><time>0</time><latitude>-33.867275</latitude><longitude>151.206964</longitude><altitude>80.000000</altitude><climb>0.000000</climb><speed>25.000000</speed><separation>0.000000</separation><track>0.000000</track><satellites>8</satellites></coordinate></coordinates></gps>

Page 9: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

General Workflow 3

Page 10: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

OAuth Issues

• Most issues occurred after adding 2nd “object”

• Like forgetting to create the OAuth token

• Or incorrectly storing credentials (one StorageByKeyName name, two credentials, doesn’t work)

• And forgetting to enable the Latitude API

• And this: Failed to retrieve access token: { "error" : "invalid_grant" }

Page 11: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Metallic Object Map

Page 12: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Lessons Learned

• OAuth is sometimes like a nightmare

– Understand the different OAuth scenarios

• Always use the latest library

• AppEngine Quota limit - small writes to datastore are a killer

• Adding a second Object feed broke everything

• This little hack actually came in useful

• But… Python was always fun!

Page 13: Sydney Python Presentation (Feb 2010) - Tracking Large Metallic Objects / Google App Engine

Thank You

• Questions?