Created
April 6, 2017 19:10
-
-
Save DustinAlandzes/26ade968439fb5e910f19561f633dad6 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 json, requests | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def tickets(): | |
| base_url = "www.milb.com" | |
| path = "/ticketing-client/json/EventTicketPromotionPrice.tiksrv" | |
| parameters = "?team_id=498&display_in=singlegame&end_date=20170705&event_type=O&home_team_id=498&site_section=Default&begin_date=20170605&venue_id=2682&year=2017&leave_empty_games=true&ticket_category=Tickets" | |
| ticketsJson = requests.get(base_url + path + parameters) | |
| dict = json.loads(ticketsJson.text) | |
| if r.status_code == 200: | |
| return render_template("tickets.html", games=dict["events"]["game"]) | |
| else: | |
| return r.status_code | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment