Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Script to compile direct mail list (not email) from online white pages.
Closed Thread
Old 03-22-2009, 10:49 PM   #1 (permalink)
 
Newb Techie

Join Date: Mar 2009

Location: Lubbock, TX

Posts: 2

bmcgonag is on a distinguished road

Send a message via Skype™ to bmcgonag
Default Script to compile direct mail list (not email) from online white pages.

I would like a script to compile a direct mail list (not email) from the online whitepages. Only for my city.

I'm sure it can be done, and I'm familiar with perl, some php, and not much else.

The deal is, if I goto white pages online, I can put in only a last name, like smith, but then it returns 300+ people, and it only lets me see 10 at a time.

I need a way to pull that 10 person data, then move to the next page.

This isn't for me to sell, and it isn't for me to spam. I want to send a single round of flyers about a charity event i'm working on. That's it.

I know there are services, but they want thousands of dollars for this type of list.

Thanks for any help.
bmcgonag is offline  
Old 03-23-2009, 11:42 AM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,389

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  
Old 03-23-2009, 05:29 PM   #3 (permalink)
 
Newb Techie

Join Date: Mar 2009

Location: Lubbock, TX

Posts: 2

bmcgonag is on a distinguished road

Send a message via Skype™ to bmcgonag
Default Re: Script to compile direct mail list (not email) from online white pages.

Thanks,

I'll give it a whirl. I'll probably be back with more questions.
bmcgonag is offline  
Old 03-23-2009, 06:16 PM   #4 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,682

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Script to compile direct mail list (not email) from online white pages.

Quote:
Originally Posted by office politics View Post
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>";
    }
  }

Note that this will only work if fopen() is allowed to access external files in the php.ini.
__________________

Need website help? PM me!
CrazeD is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The 25 Most Common Mistakes in Email Security Osiris Virus - Spyware Protection / Detection 8 02-20-2009 03:42 PM
Yahoo! Mail announces unlimited email storage maroon1 News & Polls 4 05-30-2007 11:03 PM