#NEWLINE# @ route ( '/location_recent_media' ) #NEWLINE# def location_recent_media( ) : #NEWLINE# #INDENT# access_token = request . session [ 'access_token' ] #NEWLINE# content = '<h2>Location Recent Media</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# ( recent_media , next ) = api . location_recent_media ( location_id = 514276 ) #NEWLINE# photos = [ ] #NEWLINE# for media in e : #NEWLINE# #INDENT# photos . append ( ( '<img src="%s"/>' % media . get_standard_resolution_url ( ) ) ) #NEWLINE# #UNINDENT# content += '' . join ( photos ) #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 ) )