allow multiple urls in docker
This commit is contained in:
parent
5f71eeb6a5
commit
35aeeeca72
@ -3,7 +3,9 @@ require_once(__DIR__.'/vendor/autoload.php');
|
|||||||
|
|
||||||
use \JHodges\Sitemap\Crawler;
|
use \JHodges\Sitemap\Crawler;
|
||||||
|
|
||||||
if(!$url=getenv('CRAWL_URL')){
|
if($url=getenv('CRAWL_URL')){
|
||||||
|
$urls=array_filter(array_map('trim',explode(',',$url)));
|
||||||
|
}else{
|
||||||
die("No env: CRAWL_URL\n");
|
die("No env: CRAWL_URL\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,7 +16,9 @@ if($code=getenv('CRAWL_CODE')){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$crawler=new Crawler();
|
$crawler=new Crawler();
|
||||||
|
foreach($urls as $url){
|
||||||
$crawler->crawl($url);
|
$crawler->crawl($url);
|
||||||
|
}
|
||||||
|
|
||||||
$summary=[];
|
$summary=[];
|
||||||
$details='';
|
$details='';
|
||||||
|
Loading…
Reference in New Issue
Block a user