Created
March 19, 2012 20:20
-
-
Save twaddington/2126594 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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