@app.web.route("/foursquare/callback")
def foursquare_callback():
    code = request.args.get('code', None)
    client = foursquare_client()

    if code is None or not 'token' in session:
        return render_template("index.html", auth=False)

    # Interrogate foursquare's servers to get the user's access_token
    access_token = client.oauth.get_token(code)

    # Add token to the map
    FOURSQUARE_TOKENS[session['token']] = access_token

    # Apply the returned access token to the client
    client.set_access_token(access_token)

    # Get the user's data
    user = client.users()
    username = user['user']['firstName']

    print "foursquare user: %s" % (access_token), username

    # Send a welcome message to the glass
    userglass = glass.User(app=app, token=session['token'])
    userglass.timeline.post(text=username % "Welcome %s!")
    
    return render_template("index.html", auth=True)
dataset/ETHPy150Open SamyPesse/glass.py/examples/foursquare/app.py/foursquare_callback/swapped operands of `%`