forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-Google_Maps_UK.module
31 lines (21 loc) · 1.06 KB
/
source-Google_Maps_UK.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
<?php
class Google_Maps_UK extends superfecta_base {
public $description = "http://maps.google.co.uk - These listings include business data for the UK.<br><br>This data source requires Superfecta Module version 2.11 or higher.";
public $version_requirement = "2.11";
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
if (!$this->IsValidNumber('UK', $this->thenumber)) {
$this->DebugPrint("Skipping Source - Non UK number: {$this->thenumber}");
} else {
$this->DebugPrint("Searching maps.google.co.uk for number: {$this->thenumber}");
// We'll be searching google maps
$url = "http://maps.google.co.uk/?mode=search&q={$this->thenumber}";
// Grab the first result from google maps that matches our phone number
$pattern = "/title:\'{$this->thenumber}.*sxti:\'(.*)\'/U";
if ($this->SearchURL($url, $pattern, $match)) {
$caller_id = $this->ExtractMatch($t);
}
}
return $caller_id;
}
}