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

259 views

Published on

In this presentation I give an overview of hacking Google Latitude and Google App Engine to track "friends".

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
259
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

  1. 1. Tracking large metallic objects using App Engine and Latitude Kelvin Nicholson
  2. 2. Creative Opportunities Abound
  3. 3. Python
  4. 4. An idea is born + +
  5. 5. General Workflow HTTP Post over 3G Parse POST Data (XML) Verify Location in NSW Get OAuth Credentials for “user” Post Location to Latitude API
  6. 6. 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()
  7. 7. General Workflow 2 <gps id=“metalObject"><coordinates><coordinate><fi x>3D</fix><time>0</time><latitude>33.867275</latitude><longitude>151.206964</l ongitude><altitude>80.000000</altitude><clim b>0.000000</climb><speed>25.000000</speed ><separation>0.000000</separation><track>0.0 00000</track><satellites>8</satellites></coordi nate></coordinates></gps>
  8. 8. General Workflow 3
  9. 9. 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" }
  10. 10. Metallic Object Map
  11. 11. 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!
  12. 12. Thank You • Questions?

×