[Kununu] Use tabs for indentation
This commit is contained in:
parent
f694023f7d
commit
83b5bbcc37
1 changed files with 53 additions and 53 deletions
|
@ -6,66 +6,66 @@ class KununuBridge extends BridgeAbstract {
|
||||||
const CACHE_TIMEOUT = 86400; // 24h
|
const CACHE_TIMEOUT = 86400; // 24h
|
||||||
const DESCRIPTION = "Returns the latest reviews for a company and site of your choice.";
|
const DESCRIPTION = "Returns the latest reviews for a company and site of your choice.";
|
||||||
|
|
||||||
const PARAMETERS = array(
|
const PARAMETERS = array(
|
||||||
'global' => array(
|
'global' => array(
|
||||||
'site'=>array(
|
'site'=>array(
|
||||||
'name'=>'Site',
|
'name'=>'Site',
|
||||||
'type'=>'list',
|
'type'=>'list',
|
||||||
'required'=>true,
|
'required'=>true,
|
||||||
'title'=>'Select your site',
|
'title'=>'Select your site',
|
||||||
'values'=>array(
|
'values'=>array(
|
||||||
'Austria'=>'at',
|
'Austria'=>'at',
|
||||||
'Germany'=>'de',
|
'Germany'=>'de',
|
||||||
'Switzerland'=>'ch',
|
'Switzerland'=>'ch',
|
||||||
'United States'=>'us'
|
'United States'=>'us'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'full'=>array(
|
'full'=>array(
|
||||||
'name'=>'Load full article',
|
'name'=>'Load full article',
|
||||||
'type'=>'checkbox',
|
'type'=>'checkbox',
|
||||||
'required'=>false,
|
'required'=>false,
|
||||||
'exampleValue'=>'checked',
|
'exampleValue'=>'checked',
|
||||||
'title'=>'Activate to load full article'
|
'title'=>'Activate to load full article'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'company'=>array(
|
'company'=>array(
|
||||||
'name'=>'Company',
|
'name'=>'Company',
|
||||||
'required'=>true,
|
'required'=>true,
|
||||||
'exampleValue'=>'kununu-us',
|
'exampleValue'=>'kununu-us',
|
||||||
'title'=>'Insert company name (i.e. Kununu US) or URI path (i.e. kununu-us)'
|
'title'=>'Insert company name (i.e. Kununu US) or URI path (i.e. kununu-us)'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
private $companyName='';
|
private $companyName='';
|
||||||
|
|
||||||
public function getURI(){
|
public function getURI(){
|
||||||
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
|
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
|
||||||
$site=$this->getInput('site');
|
$site=$this->getInput('site');
|
||||||
$section = '';
|
$section = '';
|
||||||
switch($site){
|
switch($site){
|
||||||
case 'at':
|
case 'at':
|
||||||
case 'de':
|
case 'de':
|
||||||
case 'ch':
|
case 'ch':
|
||||||
$section = 'kommentare';
|
$section = 'kommentare';
|
||||||
break;
|
break;
|
||||||
case 'us':
|
case 'us':
|
||||||
$section = 'reviews';
|
$section = 'reviews';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::URI.$site.'/'.$company.'/'.$section;
|
return self::URI.$site.'/'.$company.'/'.$section;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getName(){
|
function getName(){
|
||||||
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
|
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
|
||||||
return ($this->companyName?:$company).' - '.self::NAME;
|
return ($this->companyName?:$company).' - '.self::NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$full = $this->getInput('full');
|
$full = $this->getInput('full');
|
||||||
|
|
||||||
// Load page
|
// Load page
|
||||||
$html = getSimpleHTMLDOM($this->getURI());
|
$html = getSimpleHTMLDOM($this->getURI());
|
||||||
|
|
Loading…
Reference in a new issue