103 |
- |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/***************************************************************************
|
|
|
4 |
* Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in) *
|
|
|
5 |
* sendtogeo@gmail.com *
|
|
|
6 |
* *
|
|
|
7 |
* This program is free software; you can redistribute it and/or modify *
|
|
|
8 |
* it under the terms of the GNU General Public License as published by *
|
|
|
9 |
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
10 |
* (at your option) any later version. *
|
|
|
11 |
* *
|
|
|
12 |
* This program is distributed in the hope that it will be useful, *
|
|
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
15 |
* GNU General Public License for more details. *
|
|
|
16 |
* *
|
|
|
17 |
* You should have received a copy of the GNU General Public License *
|
|
|
18 |
* along with this program; if not, write to the *
|
|
|
19 |
* Free Software Foundation, Inc., *
|
|
|
20 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
21 |
***************************************************************************/
|
|
|
22 |
|
|
|
23 |
# class defines all review base service configurations
|
|
|
24 |
class ReviewBase extends Controller {
|
|
|
25 |
|
|
|
26 |
var $serviceList;
|
|
|
27 |
|
|
|
28 |
function __construct() {
|
|
|
29 |
|
|
|
30 |
$this->serviceList = [
|
|
|
31 |
"google" => [
|
|
|
32 |
"label" => "Google My Business",
|
|
|
33 |
"regex" => [
|
|
|
34 |
"reviews" => '/<span>([0-9.,]+) Google reviews<\/span>/is',
|
|
|
35 |
"rating" => '/<\/g-popup>.*?aria-label="Rated (\d+\.\d+) out/is',
|
|
|
36 |
],
|
|
|
37 |
"url_part" => '?hl=en',
|
|
|
38 |
'example' => ['https://www.google.com/search?q=kfc+Damrak']
|
|
|
39 |
],
|
|
|
40 |
"glassdoor" => [
|
|
|
41 |
"label" => "Glassdoor",
|
|
|
42 |
"regex" => [
|
|
|
43 |
"reviews" => '/"reviewCount":([0-9.,]+)/is',
|
|
|
44 |
"rating" => '/"overallRating":(\d+\.\d+)/is',
|
|
|
45 |
],
|
|
|
46 |
'example' => ['https://www.glassdoor.com/Overview/Working-at-Google-EI_IE9079.11,17.htm']
|
|
|
47 |
],
|
|
|
48 |
];
|
|
|
49 |
|
|
|
50 |
parent::__construct();
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
}
|
|
|
54 |
?>
|