Created
August 24, 2017 18:18
-
-
Save bkatiemills/a9fa38782a2ce01e3d3ce01c495fee2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
import requests, json, os | |
app = Flask(__name__, template_folder='.') | |
@app.route('/') | |
def homepage(): | |
authtoken = open(os.environ['AUTHTOKEN'], 'r').readline().strip() | |
headers = { | |
"Authorization": "token " + authtoken | |
} | |
r = requests.get( | |
'https://api.github.com/user/repos', | |
headers=headers | |
) | |
return render_template('repos.html', repos=json.loads(r.text)) | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment