It was a big week this week. First, Justin broke my faucet in the kitchen so I had to install a new one. I know you are thinking to yourself, that isn't big. It is for me as it continues to reaffirm that I am a man and can do handy things around my house.After that I fixed my cable box in one room and then took a nap while trying to watch the Cubs game. I was awoken by a phone call from Justin. All I heard was, "did you see the e-mail? 235, man. 235."1
Justin and I have been tracking World Series tickets with the Tampa Bay Rays for a couple of weeks now. The problem was, StubHub does not have RSS capability so we would have had to check the site manually all the time. Not a good option. But I figured out a way to do a script that would capture the webpage every hour and send us the results via email. And sure enough, today, World Series tickets were put on the page almost $150 below everything else we had seen. We snapped them upped immediately.Now everybody root for the Cubs and the Tampa Bay Rays.
Then, if the week wasn't good enough, this morning Allen was interviewed on WOWO in Fort Wayne, IN by Charley Butcher as we are going to be going live in my hometown starting this Saturday. The Allen Hunt Show - and all its Homestead bashing due to my inability to spell - can be heard Saturdays from 9p-12m on WOWO 1190 AM. So tell everyone you know to tune in, listen, and call - especially this Saturday as we get preempted on our flagship, News/Talk 750 WSB, due to UGA football.Not a bad couple of days if you ask me.
P.S. For those wondering how to create the Email when RSS isn't available I have included the PHP code below.
<php
// Retrieve the Date
$plushour = time() + (60 * 60);
$date = date("g A - D M j", $plushour);
//URL of File
$file = "http://www.stubhub.com/tampa-bay-rays-playoff-tickets/rays-vs-tbd-10-23-2008-587821/";
// Retreive HTML Document
$html = implode('', file($file));
$box_end = explode("</tbody>", $html);
// Create An Array for Each <tbody> Tag
$box_beg = explode("<tbody id=\"ttb\">", $box_end[1]);
for($i = 1; $i < count($box_beg); $i++){
$box_body = "<table cellpadding=\"2\">$box_beg[1]</table>";
//Send Email to Andy & Justin
$to = "Andy Borgmann <andy@2timothy42.org>";
$from = "Andy Borgmann (Webmaster) <webmaster@2timothy42.org>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from" . "\r\n";
$headers .= "Cc: Friends Name <friends.email@gmail.com>" . "\r\n";
$subject = "World Series Tickets - $date";
$body = "<html><head><title>World Series Tickets - $date</title></head>
<body style=\"font-family: Arial; font-size: 12px;\">
<div style=\"text-align: center; font-size: 24px; font-weight: bold; \">What do you think? • Anything good yet?</div>
<br />
<a href=\"$file\">$file</a><br />
<br />
<b>This is for World Series Tickets: Thursday, October 23, 2008 at Tampa Bay Rays - Home Game 2</b><br />
<br />
$box_body
</body></html>";
mail($to, $subject, $body, $headers);
}
?>Then you just setup a Cron task to execute the script every hour
0 * * * * nice -n 15 php /dir/to/script/baseball-tix.php >/dev/null 2>&1 




