diff --git a/crawler/crawler.ini b/crawler/crawler.ini deleted file mode 100644 index d15f4a6..0000000 --- a/crawler/crawler.ini +++ /dev/null @@ -1,6 +0,0 @@ -excludeafter=2592000 -sistersfp=istanzesorelle -dontloadbl=0 -timeout=5 -biglistfp=listona.json -prodlistfp=listina.json diff --git a/crawler/crawler.php b/crawler/crawler.php index 7e4e5ff..0093a61 100755 --- a/crawler/crawler.php +++ b/crawler/crawler.php @@ -95,14 +95,14 @@ if (file_exists($inifp)) { echo('Attenzione: non ho potuto leggere la configurazione dal file "'.$inifp.'", potrebbe essere non leggibile o corrotto.'.N); } } -$f=@fopen($inifp,'w'); +/*$f=@fopen($inifp,'w'); if ($f!==false) { foreach ($opts as $key=>$val) fwrite($f,$key.'='.$val.N); fclose($f); } else { echo('Attenzione: non ho potuto salvare la configurazione nel file "'.$inifp.'".'.N); -} +}*/ for ($i=1; $i<$argc; $i++) { if (substr($argv[$i],0,1)=='-') { @@ -170,7 +170,7 @@ if ($buf!==false) { echo('OK :-)'.N); $buf=explode(N,$buf); foreach ($buf as $val) { - if ($val!='' && $val{0}!='#') { + if ($val!='' && $val[0]!='#') { $kv=explode('|',$val); if ($kv[1]=='') $kv[1]=NULL; $sisters[$kv[0]]=$kv[1]; @@ -223,6 +223,7 @@ foreach ($sisters as $dom=>$bluri) { } } ksort($blinstances); +echo(count($blinstances).' istanze bloccate.'.N); foreach ($sisters as $dom=>$bluri) { echo('Recupero la lista delle istanze note a "'.$dom.'" ... '); @@ -242,6 +243,7 @@ foreach ($sisters as $dom=>$bluri) { ksort($biglist); $prodlist=array(); +$newbiglist=array(); $i=0; $qinst=count($biglist); foreach ($biglist as $dom=>$oinfo) { @@ -250,20 +252,23 @@ foreach ($biglist as $dom=>$oinfo) { if ($buf!==false) { echo('OK :-)'.N); $info=json_decode($buf,true); - $info['cr-last_checked']=time(); - $info['cr-was_ok']=true; - $biglist[$dom]=$info; - if (!array_key_exists('registrations',$info) || $info['registrations']==true) { + if (!is_null($oinfo) && array_key_exists('cr-checks',$oinfo)) + $info['cr-checks']=$oinfo['cr-checks']; + $info['cr-checks'][]=array('time'=>time(),'ok'=>true); + $newbiglist[$dom]=$info; + if (array_key_exists('registrations',$info) && $info['registrations']==true + && array_key_exists('stats',$info) && array_key_exists('user_count',$info['stats'] && $info['stats']['user_count']>10 && $info['stats']['user_count']<=30000 + && array_key_exists('domain_count',$info['stats'] && $info['stats']['domain_count']>=500 + ) { $prodlist[$dom]=$info; echo('"'.$dom.'" aggiunta alla lista delle istanze ok! :-)'.N); } } else { echo('ERRORE :-( ... '); - if (is_null($oinfo) || time()-$oinfo['cr-last_checked']<=$opts['excludeafter']) { + if (is_null($oinfo) || time()-$oinfo['cr-checks'][count($oinfo['cr-checks'])-1]['time']<=$opts['excludeafter']) { echo('ma riproveremo...'.N); - $oinfo['cr-last_checked']=time(); - $oinfo['cr-was_ok']=false; - $biglist[$dom]=$oinfo; + $oinfo['cr-checks'][]=array('time'=>time(),'ok'=>false); + $newbiglist[$dom]=$oinfo; } else { echo('e non riproveremo...'.N); } @@ -271,12 +276,17 @@ foreach ($biglist as $dom=>$oinfo) { $i++; } -$json=json_encode($biglist,JSON_PRETTY_PRINT); +$json=json_encode($newbiglist,JSON_PRETTY_PRINT); file_put_contents($opts['biglistfp'],$json); $json=json_encode($prodlist,JSON_PRETTY_PRINT); file_put_contents($opts['prodlistfp'],$json); -echo('Totale istanze nella listona: '.count($biglist).N); +$diff=count($newbiglist)-count($biglist); +if ($diff<0) + $diff='-'.$diff; +else + $diff='+'.$diff; +echo('Totale istanze nella listona: '.count($newbiglist).' ('.$diff.' rispetto all\'ultima volta)'.N); echo('Totale istanze nella listina di quelle occhei: '.count($prodlist).N); ?> diff --git a/web/about_en.php b/web/about_en.php index 3885b63..5b55abe 100644 --- a/web/about_en.php +++ b/web/about_en.php @@ -3,6 +3,7 @@
@@ -13,7 +14,7 @@

Here are some contacts of those involved

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 4.0 International license.

diff --git a/web/about_it.php b/web/about_it.php index 3d18c5b..ad59dac 100644 --- a/web/about_it.php +++ b/web/about_it.php @@ -3,6 +3,7 @@
@@ -13,7 +14,7 @@

Ecco alcuni contatti

Eccetto dove diversamente specificato, i contenuti di questo sito sono rilasciati sotto Licenza Creative Commons Attribuzione 4.0 Internazionale.

diff --git a/web/home_en.php b/web/home_en.php index 1583a91..fe57929 100644 --- a/web/home_en.php +++ b/web/home_en.php @@ -1,7 +1,6 @@
diff --git a/web/index.php b/web/index.php index 3762b7b..c3acd22 100644 --- a/web/index.php +++ b/web/index.php @@ -10,12 +10,12 @@ for ($i=0; $i<$ndir; $i++) $prepath.='../'; $menu=array( - 'guide'=>array('lijs'=>null, 'href'=>$instpath, 'title'=>'Guide', 'selected'=>false, 'submenu'=>null), - 'instances'=>array('lijs'=>null, 'href'=>$instpath.'/instances', 'title'=>'Instances', 'selected'=>false, 'submenu'=>null), - 'about'=>array('lijs'=>null, 'href'=>$instpath.'/about', 'title'=>'About', 'selected'=>false, 'submenu'=>null), - 'language'=>array('lijs'=>null, 'href'=>null, 'title'=>'Language', 'selected'=>false, 'submenu'=>array( - 'inglese'=>array('lijs'=>'onclick=golang("en")', 'href'=>null, 'title'=>'English', 'selected'=>false, 'submenu'=>null), - 'italiano'=>array('lijs'=>'onclick=golang("it")', 'href'=>null, 'title'=>'Italiano', 'selected'=>false, 'submenu'=>null) + 'guide'=>array('liadd'=>null, 'href'=>$instpath, 'title'=>'Guide', 'selected'=>false, 'submenu'=>null), + 'instances'=>array('liadd'=>null, 'href'=>$instpath.'/instances', 'title'=>'Instances', 'selected'=>false, 'submenu'=>null), + 'about'=>array('liadd'=>null, 'href'=>$instpath.'/about', 'title'=>'About', 'selected'=>false, 'submenu'=>null), + 'language'=>array('liadd'=>null, 'href'=>null, 'title'=>'Language', 'selected'=>false, 'submenu'=>array( + 'inglese'=>array('liadd'=>'onclick="golang(\'en\')" onmouseover="this.style.cursor=\'pointer\'"', 'href'=>null, 'title'=>'English', 'selected'=>false, 'submenu'=>null), + 'italiano'=>array('liadd'=>'onclick="golang(\'it\')" onmouseover="this.style.cursor=\'pointer\'"', 'href'=>null, 'title'=>'Italiano', 'selected'=>false, 'submenu'=>null) ) ) ); @@ -44,10 +44,10 @@ switch($path) { 'atit'=>' - Guide', 'js'=>array('shsum','guideanchors','scrolltrack') ); - $menu['guide']['lijs']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; + $menu['guide']['liadd']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; $menu['guide']['href']=null; $menu['guide']['selected']=true; - $menu['language']['submenu']['inglese']['lijs']=null; + $menu['language']['submenu']['inglese']['liadd']=null; $menu['language']['submenu']['inglese']['selected']=true; break; @@ -59,10 +59,10 @@ switch($path) { 'js'=>array('shsum','guideanchors','scrolltrack') ); tradmenu('it'); - $menu['guide']['lijs']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; + $menu['guide']['liadd']='onclick="shsum()" onmouseover="this.style.cursor=\'pointer\'"'; $menu['guide']['href']=null; $menu['guide']['selected']=true; - $menu['language']['submenu']['italiano']['lijs']=null; + $menu['language']['submenu']['italiano']['liadd']=null; $menu['language']['submenu']['italiano']['selected']=true; break; @@ -75,7 +75,7 @@ switch($path) { ); $menu['instances']['href']=null; $menu['instances']['selected']=true; - $menu['language']['submenu']['inglese']['lijs']=null; + $menu['language']['submenu']['inglese']['liadd']=null; $menu['language']['submenu']['inglese']['selected']=true; break; @@ -89,7 +89,7 @@ switch($path) { tradmenu('it'); $menu['instances']['href']=null; $menu['instances']['selected']=true; - $menu['language']['submenu']['italiano']['lijs']=null; + $menu['language']['submenu']['italiano']['liadd']=null; $menu['language']['submenu']['italiano']['selected']=true; break; @@ -102,7 +102,7 @@ switch($path) { ); $menu['about']['href']=null; $menu['about']['selected']=true; - $menu['language']['submenu']['inglese']['lijs']=null; + $menu['language']['submenu']['inglese']['liadd']=null; $menu['language']['submenu']['inglese']['selected']=true; break; @@ -116,7 +116,7 @@ switch($path) { tradmenu('it'); $menu['about']['href']=null; $menu['about']['selected']=true; - $menu['language']['submenu']['italiano']['lijs']=null; + $menu['language']['submenu']['italiano']['liadd']=null; $menu['language']['submenu']['italiano']['selected']=true; break; @@ -148,7 +148,7 @@ function buildmenu($menu) { global $menuout; foreach ($menu as $key=>$arr) { $menuout.='