
Originally Posted by
Marcymarc
I run a radio station too, I need to keep track of what other stations are playing. Quiet a normal thing to do in the industry.
Good enough for me.
OK, let's get back to business here. I'm not aware of any specific program for this. And it would depend upon what PHP version, as to the exact commands required, but that can be worked out either by using a fall back for older versions or by your knowing what version of PHP you have. What version do you have?
Not long ago I worked out a method whereby one website could capture a page of another. There is a form. The user inputs the desired page and submits. The page's content is fed back to the user with a Flash application superimposed over it in the lower right corner. There's quite a bit of detail to how this is done, but you don't need to know all that. The basic thing is to grab the page:
PHP Code:
$url = 'http://www.somedomain.com/';
$requested_page = file_get_contents($url);
and write to the log file:
PHP Code:
$file = 'somedomain.log'; //May be any filename that you like, or optained from the $url variable in some fashion.
if(phpversion() >= 5.1){
file_put_contents($file, $requested_page, FILE_APPEND | LOCK_EX);
} else {
$afile = fopen($file, 'a');
fwrite($afile, $requested_page);
fclose($afile);
}
There are all sorts of things one could do with the $requested_page variable to alter it (like strip out HTML tags, and/or everything except that data you are looking for) after it's obtained and before writing it to the log file.
As I alluded to before, the page that this code is on could be run periodically. Data could be passed to the page to set the URL to grab and/or the filename of the file to be written to.
Bookmarks