Page 1 of 1

content retrieval script

Posted: Sun Nov 28, 2004 12:24 pm
by ferric
Hello,

i'm looing for a free script that will allow me to retrieve the show times located at this page: http://schedule.adultswim.com/servlet/S ... &filter=as

I've searched all over the web and have not found a script that works. Thanks

Posted: Sun Nov 28, 2004 3:56 pm
by rehfeld
you should learn how to use regex..

every page is different, and will require the regex pattern to be tailored to work correctly. there is no one does all script for this.

but ill give you a nudge in the right direction

Code: Select all

<?php

$html = file_get_contents('http://website.com');

$pattern = '/<td>(.*)<\/td>/i';

preg_match_all($pattern, $html, $matches);



echo '<pre>';

print_r($matches);

?>
your going to need a much more complicated regex pattern for it to work properly, which, i cant help with.

Posted: Sun Nov 28, 2004 4:17 pm
by John Cartwright
Well put, you are going to need to know exackly how the tables are formatted, and then come up with a regular expression for each website you are retrieving the data from. You are then going to need to set up something like a chron job to update the site every 15 minutes or so for new listings.

helpful links: [php_man]regex[/php_man], [php_man]preg_match[/php_man]