forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-CanPagesCA.module
37 lines (28 loc) · 1.19 KB
/
source-CanPagesCA.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
30
31
32
33
34
35
36
37
<?php
class CanPagesCA extends superfecta_base {
public $description = "http://www.canpages.ca - These listings include business and residential data for Canada.";
public $version_requirement = "2.11";
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
$npa = "";
$nxx = "";
$station = "";
if (!$this->IsValidNumber('CA', $thenumber, $npa, $nxx, $station)) {
$this->DebugPrint("Skipping Source - Non Canadian number: " . $thenumber);
} else {
$this->DebugPrint("Searching www.canpages.ca - ({$npa}) {$nxx}-{$station}...");
// By default, there is no match
$name = "";
$url = "http://www.canpages.ca/list.jsp?na=" . $npa . "-" . $nxx . "-" . $station . "&ct=b2n+1x6"; //working June 19, 2012
$pattern = '/name : \"(.*?)\",/i'; //working June 19, 2012
// Patterns to search for
$regexp = array(
$pattern,
);
if ($this->SearchURL($url, $regexp, $match, NULL, TRUE)) {
$caller_id = $this->ExtractMatch($match);
}
}
return($caller_id);
}
}