02-19-2006, 05:09 PM
| THREAD STARTER
#1 (permalink)
|
| NamePros Member Join Date: Jan 2006 Location: Melbourne, Australia
Posts: 26
| [PHP] Rip Info From Website I can echo the whole page, but as soon as I strip out the information I want (namely the phrase "It's X minutes to midnight"), I simply get ".thebulletin.org Port 80". I have done this kinda thing before with others sites an using fopen (which does not work here)
The full code is here PHP Code: require_once "HTTP/Request.php";
????: NamePros.com http://www.namepros.com/programming/169274-php-rip-info-from-website.html $req =& new HTTP_Request("http://www.thebulletin.org/doomsday_clock/current_time.htm");
$req->setMethod(HTTP_REQUEST_METHOD_POST);
if (!PEAR::isError($req->sendRequest())) {
$handle = $req->getResponseBody();
} else {
$handle = "";
}
$pos = strpos($handle, 'minutes to midnight');
$pos2 = $pos+100;
$pos = $pos-50;
$domain = substr($handle, $pos, $pos2);
echo $domain;
Any Ideas on how to make this work??, Thanks |
| |