@app.subscriptions.location
def change_location(user):
    # Get last known location
    location = user.location()
    llat = location.get('latitude')
    llong = location.get('longitude')

    # Get foursquare client
    client = foursquare.Foursquare(access_token=FOURSQUARE_TOKENS[user.token])

    # Search venues on Foursquare
    venues = client.venues.search(params={'ll': llat+','+llong, 'llAcc': location.get('accuracy')})
    if len(venues['venues']) > 0:
    	# Post card with result
    	user.timeline.post_template("venue.html", venue=venues['venues'][0], llat=llat, llong=llong)
dataset/ETHPy150Open SamyPesse/glass.py/examples/foursquare/app.py/change_location/original