Skip to content

Instantly share code, notes, and snippets.

@twaddington
Created March 19, 2012 20:20
Show Gist options
  • Save twaddington/2126594 to your computer and use it in GitHub Desktop.
Save twaddington/2126594 to your computer and use it in GitHub Desktop.
time = "10 minutes ago"
if ((distance_moved *since* time) < 200):
# Possibly return a 420 or 429 response code? Possibly not a 429,
# since we might want to use that for actual API request rate limiting.
#
# http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#420
response = {
"error": "back_off",
"error_message": "...",
"latitude": 125.45,
"longitude": 45.67,
"radius": 800
}
# Client consumes the error, turns off location updates and sets a proximity
# alert to re-enable location tracking when the device leaves the area.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment