def findLocations(): try: lat_lng = request.args.get('LAT-LNG') return (worker.add_job("LAT-LNG=" + lat_lng) + "\n") except: return ("Incorrect URL\n") return ("If you see this, please contact the the server admin\n")
def findLATs(): try: lat = request.args.get('LAT') return (worker.add_job("LAT=" + lat) + "\n") except: return ("Incorrect URL\n") return ("If you see this, please contact the the server admin\n")
def findShapes(): try: shape = request.args.get('shape', type=str) return (worker.add_job("Shape=" + shape) + "\n") except: return ("Incorrect URL\n") return ("If you see this, please contact the the server admin\n")
def findCities(): try: city = request.args.get('city', type=str) return (worker.add_job("City=" + city) + "\n") except: return ("Incorrect URL\n") return ("If you see this, please contact the the server admin\n")
def executeCommand(command): try: if "%" in command: command = urllib2.unquote(command) vals = command.split("=") methods = [ "All", "Date", "Country", "City", "State", "Shape", "LAT", "LNG", "LAT-LNG" ] if vals[0] in methods: return (worker.add_job(command) + "\t Sent\n") except: return ("Invalid Command\n") return ("If you see this, please contact the the server admin\n")
def findDates(): try: start = request.args.get('start', type=str) end = request.args.get('end', type=str) if "%" in start: start = urllib2.unquote(start) if "\'" in start: start = start.strip("\'") print(start) if "%" in end: end = urllib2.unquote(end) if "\'" in end: end = end.strip("\'") return (worker.add_job("Date=" + start + "-" + end) + "\n") except: return ("Incorrect URL\n") return ("If you see this, please contact the the server admin\n")
def getUserFriendly(): #gets all data return (worker.add_job("All=None") + "\n")