Posted By

rowntreerob on 03/19/12


Tagged

history latitude photo geotags


Versions (?)

picasa timestamps and latitude history list


 / Published in: Bash
 

URL: https://code.google.com/apis/explorer/

Get album feed from picasa, fields (link @rel=edit, timestamp ) add raw offset value to adjust min:max timestamps from local to UTC plug the adjusted timestamps into latitude request

Note: that if you have latitude/history setting=ON , then any time any app uses the location Provider, the returned value (lat/long) winds up on Latitude.

  1. --oauth2 playground authenticated request on picasa for an album feed...
  2.  
  3. GET /data/feed/api/user/default/albumid/5720219664565209553?fields=entry/link[@rel="edit"],entry/gphoto:timestamp HTTP/1.1
  4. Host: picasaweb.google.com
  5. Authorization: OAuth ya29.AHES...
  6.  
  7. <?xml version='1.0' encoding='UTF-8'?>
  8. <feed xmlns='http://www.w3.org/2005/Atom' xmlns:gphoto='http://schemas.google.com/photos/2007'><entry>
  9. <link rel='edit' type='application/atom+xml' href='https://picasaweb.google.com/data/entry/api/user/113172267863552078400/albumid/5720219664565209553/photoid/5720219691294532386/11'/>
  10. <gphoto:timestamp>1331807465000
  11.  
  12. ...
  13. <gphoto:timestamp>1331810092000</gphoto:timestamp></entry></feed>
  14.  
  15. -- adjust first/last timestamps by rawoffset due to TZ settings on the camera
  16.  
  17. -- call latitude using the api Explorer w/ oauth 2 access granted
  18.  
  19. GET https://www.googleapis.com/latitude/v1/location?max-results=100&max-time=1331835292000&min-time=1331832665000&pp=1&key={YOUR_API_KEY}
  20.  
  21. Authorization: OAuth ya29.AHES6ZQR....
  22.  
  23. Response
  24.  
  25. 200 OK
  26. - Hide headers -
  27. cache-control: private, max-age=0, must-revalidate, no-transform
  28. content-type: application/json; charset=UTF-8
  29. date: Mon, 19 Mar 2012 02:07:30 GMT
  30. etag: "cvzYuLoLPgEy7KdPdboxcryL9PM/Bm-Z2ysk9f9syMfpz1VcXVD6p5c"
  31. expires: Mon, 19 Mar 2012 02:07:30 GMT
  32. server: GSE
  33. {
  34. "data": {
  35. "kind": "latitude#locationFeed",
  36. "items": [
  37. {
  38. "kind": "latitude#location",
  39. "timestampMs": "1331835283382",
  40. "latitude": 37.7749295,
  41. "longitude": -122.4194155
  42. },
  43. {
  44. "kind": "latitude#location",
  45. "timestampMs": "1331835242217",
  46. "latitude": 37.7749295,
  47. "longitude": -122.4194155
  48. },
  49. {
  50. "kind": "latitude#location",
  51. "timestampMs": "1331835202609",
  52. "latitude": 37.7749295,
  53. "longitude": -122.4194155
  54. },
  55. {
  56. "kind": "latitude#location",
  57. "timestampMs": "1331835140225",
  58. "latitude": 37.7749295,
  59. "longitude": -122.4194155
  60. },

Report this snippet  

You need to login to post a comment.