mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-17 17:10:48 +02:00
Initial commit
Functional, without SSO
This commit is contained in:
24
sources/lib/AdService/ParserFactory.php
Normal file
24
sources/lib/AdService/ParserFactory.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace AdService;
|
||||
|
||||
class ParserFactory
|
||||
{
|
||||
/**
|
||||
* @param string $url
|
||||
* @return \AdService\Parser\AbstractParser
|
||||
*/
|
||||
public static function factory($url)
|
||||
{
|
||||
if (false !== strpos($url, "leboncoin.fr")) {
|
||||
return new Parser\Lbc();
|
||||
}
|
||||
if (false !== strpos($url, "olx.ua")) {
|
||||
return new Parser\Olx();
|
||||
}
|
||||
if (false !== strpos($url, "seloger.com")) {
|
||||
return new Parser\Seloger();
|
||||
}
|
||||
throw new Exception("No parser found");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user