forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-White_Pages.module
29 lines (22 loc) · 1 KB
/
source-White_Pages.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
class White_Pages extends superfecta_base {
public $description = "http://www.whitepages.com - These listings will return both residential and business listings. Some Canada data available.";
public $version_requirement = "2.11";
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
$npa = "";
$nxx = "";
$station = "";
if (!$this->IsValidNumber(array('US', 'CA'), $thenumber, $npa, $nxx, $station)) {
$this->DebugPrint("Skipping Source - Non Canadian/US number: " . $thenumber);
} else {
$this->DebugPrint("Searching White Pages ... ");
$url = "http://www.whitepages.com/business/reverse_phone?phone_number=${thenumber}";
$pattern = '/show_details_fields: true,name:\'(.*)\',city:\'[a-z]/i';
if ($this->SearchURL($url, $pattern, $match, NULL, TRUE)) {
$caller_id = $this->ExtractMatch($match);
}
}
return($caller_id);
}
}