-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnearby.py
executable file
·36 lines (25 loc) · 891 Bytes
/
nearby.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import fusion
import facility
class NearbyPage(webapp.RequestHandler):
def get(self):
service=self.request.get("service")
latitude=self.request.get("latitude")
longitude=self.request.get("longitude")
self.response.headers['Content-Type'] = 'text/plain'
response="Service: "+service+"\nLatitude: "+\
latitude+"\nLongitude: "+longitude
#database = fusion.DataBase(2334172)
#database = fusion.DataBase(2337646)
database = fusion.DataBase(2921075)
my_facilities = database.nearbyRequest(latitude,longitude,service)
response = facility.json(my_facilities)
self.response.out.write(response)
application = webapp.WSGIApplication(
[('/nearby',NearbyPage)],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()