Skip to content

Commit

Permalink
Added Support for loading by show id
Browse files Browse the repository at this point in the history
  • Loading branch information
athuler committed Feb 9, 2024
1 parent a0ba7cf commit 3c92d68
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@
// Falsettos is the default URL
$url = "https://tickets.uchicago.edu/Online/default.asp?doWork::WScontent::loadArticle=Load&BOparam::WScontent::loadArticle::article_id=80CABB0D-1081-4DC3-BDEC-FFBD195F45E1";

// Check Whether a Show is Provided
// Check Whether a Show URL is Provided
if(isset($_GET["show"]) ){

$_GET["show"] = strtolower($_GET["show"]);


// Check Whether the Passed Show is Valid
if(array_key_exists($_GET["show"], $json)){

// Passed is a custom URL
$url = "https://tickets.uchicago.edu/Online/default.asp?doWork::WScontent::loadArticle=Load&BOparam::WScontent::loadArticle::article_id=" . $json[$_GET["show"]];

} else if (in_array(strtoupper($_GET["show"]), $json)){

// Passed is an ID which has a custom URL
// Redirect to the custom URL
header("Location: " . array_search(strtoupper($_GET["show"]), $json));

} else {
echo("Invalid Show!<br/>");

// Passed is not a Custom Show URL
$url = "https://tickets.uchicago.edu/Online/default.asp?doWork::WScontent::loadArticle=Load&BOparam::WScontent::loadArticle::article_id=" . $_GET["show"];
}
}


// Scrape Ticketing Webpage
$opts = array('http'=>array('header' => "User-Agent:" . $_SERVER['HTTP_USER_AGENT']));
$context = stream_context_create($opts);
Expand Down

0 comments on commit 3c92d68

Please sign in to comment.