forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-Yellow_Pages.module
29 lines (22 loc) · 1.08 KB
/
source-Yellow_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 Yellow_Pages extends superfecta_base {
public $description = "http://yellowpages.addresses.com - This will return only business listings, it will not return residential listings.";
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 Yellow Pages ... ");
$url = "http://yellowpages.addresses.com/yellow-pages/phone:" . $thenumber . "/listings.html";
$pattern = '/<td style=\"width: 60%; padding-left: 10px; vertical-align: top; text-align: left;\">(.*)<\/a><\/h2><div class=\"sml_txt\">/i';
if ($this->SearchURL($url, $pattern, $match, NULL, TRUE)) {
$caller_id = $this->ExtractMatch($match);
}
}
return($caller_id);
}
}