forked from kingarthur2/superfecta-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource-PaginasAmarillas_DO.module
33 lines (23 loc) · 1.19 KB
/
source-PaginasAmarillas_DO.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
<?php
class PaginasAmarillas_DO extends superfecta_base {
public $description = "http://paginasamarillas.com.do - Business listings for the Dominican Republic";
public $version_requirement = "2.11";
function get_caller_id($thenumber, $run_param=array()) {
$caller_id = null;
if (!$this->IsValidNumber('DO', $this->thenumber)) {
$this->DebugPrint("Skipping Source - Not a valid 10 digit Dominican number: {$this->thenumber}");
} else {
$this->DebugPrint("Searching PaginasAmarillas for number: {$this->thenumber}");
// We'll be searching paginasamarillas.com.do
$url = "http://www.paginasamarillas.com.do/Searchpg.aspx?SearchType=neg&telefono={$this->thenumber}&searchAction=adv&ciudad=ALL";
// Grab the first result from google maps that matches our phone number
$pattern = array(
"/<div class=\"anunciantesover2\" id=\"div.*\" title=\"(.+)\">/",
"/\" title=\"url:(.+)\" rel=\"nofollow/");
if ($this->SearchURL($url, $pattern, $match)) {
$caller_id = $this->ExtractMatch($match);
}
}
return $caller_id;
}
}