#NEWLINE# @ route ( '/location_search' ) #NEWLINE# def location_search( ) : #NEWLINE# #INDENT# access_token = request . session [ 'access_token' ] #NEWLINE# content = '<h2>Location Search</h2>' #NEWLINE# if ( not access_token ) : #NEWLINE# #INDENT# return 'Missing Access Token' #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# api = client . InstagramAPI ( access_token = access_token , client_secret = CONFIG [ 'client_secret' ] ) #NEWLINE# location_search = api . location_search ( lat = '37.7808851' , lng = '-122.3948632' , distance = 1000 ) #NEWLINE# locations = [ ] #NEWLINE# for location in location_search : #NEWLINE# #INDENT# locations . append ( ( '<li>%s  <a href="https://www.google.com/maps/preview/@%s,%s,19z">Map</a>  </li>' % ( location . name , location . point . latitude , locations . point . longitude ) ) ) #NEWLINE# #UNINDENT# content += '' . join ( locations ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# print ( e ) #NEWLINE# #UNINDENT# return ( '%s %s <br/>Remaining API Calls = %s/%s' % ( get_nav ( ) , content , api . x_ratelimit_remaining , api . x_ratelimit ) )