Skip to content

Commit

Permalink
web interface
Browse files Browse the repository at this point in the history
  • Loading branch information
mabotkin committed Dec 24, 2016
1 parent 302d6ae commit a800b84
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

START_YEAR = 2009
CUR_YEAR = 2016
CUR_WEEK = 11
CUR_WEEK = 15
REG_WEEKS = 17
POST_WEEKS = 4

Expand Down
27 changes: 27 additions & 0 deletions nfl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from flask import Flask
import subprocess
import os

dir_path = os.path.dirname(os.path.realpath(__file__))

app = Flask(__name__)

color = {}
color["\n"] = "<br>"
color["[0m"] = "</font>"
color["[36m"] = "<font color='blue'>"
color["[32m"] = "<font color='green'>"
color["[33m"] = "<font color='gold'>"
color["[35m"] = "<font color='orange'>"
color["[31m"] = "<font color='red'>"

@app.route("/")
def root():
proc = subprocess.Popen(["python2", dir_path + "/predict.py"], stdout=subprocess.PIPE)
(out, err) = proc.communicate()
for i in color:
out = out.replace(i,color[i])
return out, 200

if __name__ == "__main__":
app.run(host='0.0.0.0', port=5001)
4 changes: 2 additions & 2 deletions predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import requests

#schedule URL
URL = "http://www.espn.com/nfl/schedule/_/week/12"
YEAR = 2016
WEEK = 12
WEEK = 16
URL = "http://www.espn.com/nfl/schedule/_/week/" + str(WEEK)

SORT_BY_CONFIDENCE = True
H_TEAM_ADV = 20
Expand Down

0 comments on commit a800b84

Please sign in to comment.