NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [PHP] Rip Info From Website

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 02-19-2006, 05:09 PM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Jan 2006
Location: Melbourne, Australia
Posts: 26
ShadowPeo is an unknown quantity at this point
 



[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
ShadowPeo is offline  
Old 02-19-2006, 05:22 PM   #2 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
This will work.

PHP Code:
<?php

$data 
file_get_contents('http://www.thebulletin.org/doomsday_clock/current_time.htm');

preg_match("/<h1><br>(.*?)<\/h1>/si"$data$matches);

echo 
trim(strip_tags($matches[1]));
????: NamePros.com http://www.namepros.com/showthread.php?t=169274

?>
http://www.secondversion.com/doomsday.php
Eric is offline  
Old 02-19-2006, 06:37 PM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Jan 2006
Location: Melbourne, Australia
Posts: 26
ShadowPeo is an unknown quantity at this point
 



Thanks, hadnt thought of regular expressions
ShadowPeo is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
FuelReport.com - be great name for energy info website Domagon Domains For Sale - Auctions 0 02-01-2006 12:50 AM
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
=====> A few names for sale ==> Click Here johnn Domains For Sale - Make Offer 2 02-04-2004 10:05 AM
For your .info JMJ Domains For Sale - Make Offer 1 11-30-2003 08:22 PM

 
All times are GMT -7. The time now is 02:09 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger