View Single Post
Old 03-23-2009, 11:42 AM   #2 (permalink)
office politics
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,425

office politics will become famous soon enough

Default Re: Script to compile direct mail list (not email) from online white pages.

php should be able to load pages into memory. then you can parse the html code.

here's some things to play with

PHP Code:
//retrieve HTML code for a given address
function getPageSource($address) {
  
$page fopen($address,"r");
  
$source stream_get_contents($page);
  
fclose($page);
  return 
$source;
}

//
function getImgLine($html$find$break) {
  
$lines explode($break$html);
  foreach(
$lines as $data) {
    if(
substr_count($data$find)) {
      return 
$data;
      echo 
str_replace(">","",$data)."<br>";
    }
  }


office politics is offline