I'm using the script below to fetch the times for a movie to display on my website. I can only get it to display whats in the attached image. Can somebody tell me how I can just get it to display the rows that contain the movies and times?
Here's the URL where I'm pull the content from: http://www.fandango.com/my_box_office.asp?txtCityZip=annapolis%2C+md&theaternamefilter=crown+annapolis+mall&x=0&y=0
I've been trying to figure this out for hours and I can't seem to get past this part. I'd appreciate it if somebody could tell me how I can get it to just show the rows then I can build my table before and after the php code:
<html>
<head>
<title>Movie Times</title>
<style type="text/css">
<!--
.bbu { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #003399; text-decoration: underline}
.b12u { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 600; color: #003399; text-decoration: underline}
.blue11u { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #003399; text-decoration: underline; line-height: 14px}
.blk10 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000}
.gray10 { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #666666}
.g11 { font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; color: #666666}
.showtimespast { font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; color: #999999}
.r11u { font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; color: #CC0000; text-decoration: underline}
.w12b { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 600; color: #FFFFFF}
.vtb { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #333333; font-weight: 600}
-->
</style>
</head>
<body>
<?
/*
Contentgrabber v3.0a
Copyright (C) Arvid Bux
Distributed under the terms of the GNU General Public License
[email]Arvid@ArvidBux.nl[/email]
[url]www.arvidbux.nl[/url]
THIS IS AN APLHA VERSION, SO WHEN YOU ENCOUNTER BUGS MAIL THEM TO [email]ARVID@ARVIDBUX.NL[/email]
OR POST THEM AT:
[url]http://www.arvidbux.nl/comments.php?id=P89_0_1_0[/url]
*/
$url = "http://www.fandango.com/my_box_office.asp?txtCityZip=annapolis%2C+md&theaternamefilter=crown+annapolis+mall&x=0&y=0";
$file = "content.inc"; // file to write to. remember to chmod 777 to not get errors
$unique_start = '<table width="677" border="0" cellspacing="0" cellpadding="0">'; // Where to begin to grab
$unique_end = '<table width="678" border="0" cellspacing="0" cellpadding="0">'; // Where to end the grab
######################################################
## No editing below here
## Editing below this line voids warranty :-)
######################################################
ini_set('max_execution_time', '0');
flush ();
// fetch domain from url
$fetch_domain = parse_url($url);
$fetch_domain = $fetch_domain[host];
// Host checking code
$socket_handle = fsockopen("$fetch_domain", 80, $error_nr, $error_txt,30);
if(!$socket_handle)
{
print("Cannot make a connection to: $fetch_domain and therefore cannot collect your requested data");
$contents = implode("",@file( $file ) );
echo $contents;
exit;
}
$fd= fread(fopen("$url", "r"), 100000);
if ($fd)
{
$start= strpos($fd, "$unique_start");
$finish= strpos($fd, "$unique_end");
$length= $finish-$start;
$code=Substr($fd, $start, $length);
}
// $code = preg_replace("new code", "old code", $code);
// uncomment the above line to edit the output
echo $code;
$tmpfile = fopen($file,"w+");
$fp = fwrite($tmpfile,$code);
fclose($tmpfile);
flush ();
?>
</body>
</html>
John