forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsource-LocalTel_CH.module
More file actions
27 lines (19 loc) · 846 Bytes
/
source-LocalTel_CH.module
File metadata and controls
27 lines (19 loc) · 846 Bytes
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
<?php
class LocalTel_CH extends superfecta_base {
public $description = "http://local.ch - These listings include business and residential data for Switzerland.";
public $version_requirement = "2.11";
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
if ((!$this->IsValidNumber('CH', $thenumber))) {
$this->DebugPrint("Skipping Source - Not a valid Swiss number: {$thenumber}");
} else {
$this->DebugPrint("Searching Local.ch-Swiss ... ");
$url = "http://tel.search.ch/index.en.html?was=$thenumber";
$pattern = "/class=\"(?:fn|fn org)\">(.*)<\/a>/";
if ($this->SearchURL($url, $pattern, $match)) {
$caller_id = $this->ExtractMatch($match);
}
}
return($caller_id);
}
}