import requests
from flask import Flask, render_template
app = Flask(__name__)
FOOTYSTATS_API_URL = "https://footystats.org/stats/draws"
def get_high_odds_matches():
response = requests.get(FOOTYSTATS_API_URL)
if response.status_code == 200:
data = response.json()
matches = []
for match in data.get("matches", []):
home_odds = match.get("home_odds", 0)
away_odds = match.get("away_odds", 0)
if home_odds >= 1.8 or away_odds >= 1.8:
matches.append({
"home_team": match['home_team'],
"away_team": match['away_team'],
"home_odds": home_odds,
"away_odds": away_odds
})
return matches
return []
@app.route("/")
def index():
matches = get_high_odds_matches()
return render_template("index.html", matches=matches)
if __name__ == "__main__":
app.run(port=5000)