firefly007 |
10th September 2014 08:56 |
Tv Guide (malaysiantvonline.com) as requested by hatijahat
1 Attachment(s)
Not sure what source this is for but its simple to mod it according..
Create a file called "guide.php"
Code:
include_once('simple_html_dom.php');
$day = $_GET["day"];
if ($day == "mon"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/monday.htm';
}elseif ($day == "tue"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/tuesday.htm';
}elseif ($day == "wed"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/wednesday.htm';
}elseif ($day == "thu"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/thursday.htm';
}elseif ($day == "fri"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/friday.htm';
}elseif ($day == "sat"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/saturday.htm';
}elseif ($day == "sun"){
$OUT = 'http://malaysiantvonline.com/RegularTV/Daily/sunday.htm';
}
$fp = fopen("guide_cache.php", "w");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $OUT);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_exec($ch);
$html = file_get_html("guide_cache.php");
foreach($html->find('#weekly-listing') as $e)
$main = $e->innertext . '';
print '
';
print $main;
?>
Then save the attachment (simple_html_dom.php) to www folder.
|