Skip to content

Instantly share code, notes, and snippets.

@ssherar
Created April 6, 2015 13:14
Show Gist options
  • Save ssherar/2341804d2556201b5efa to your computer and use it in GitHub Desktop.
Save ssherar/2341804d2556201b5efa to your computer and use it in GitHub Desktop.
from flask import Flask, render_template, request
import nikeplus
app = Flask(__name__) # creates the application body
@app.post("/nikeplus/activity")
def nike_activity():
data = request.post.data
username = data["username"]
password = data["password"]
API = nikeplus.API(username, password, locale="en_GB")
# do something
return render_template("activity", activity["name"])
if __name__ == "__main__": # if the file is called from `python file.py` instead of being imported
app.run(debug=True) # Will run on port 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment