Commit c1da424b authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Added Date to additional information of minisucher and opencrawl politik results

parent 4136eff4
...@@ -42,6 +42,15 @@ class Minisucher extends Searchengine ...@@ -42,6 +42,15 @@ class Minisucher extends Searchengine
$descr .= $description->__toString(); $descr .= $description->__toString();
} }
$descr = strip_tags($descr); $descr = strip_tags($descr);
$dateString = $result->xpath('//doc/date[@name="documentDate"]')[0]->__toString();
$date = date_create_from_format("Y-m-d\TH:i:s\Z", $dateString);
$dateVal = $date->getTimestamp();
$additionalInformation = ['date' => $dateVal];
$provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString(); $provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
if (isset($providerCounter[$provider]) && $providerCounter[$provider] > 10) { if (isset($providerCounter[$provider]) && $providerCounter[$provider] > 10) {
...@@ -67,7 +76,8 @@ class Minisucher extends Searchengine ...@@ -67,7 +76,8 @@ class Minisucher extends Searchengine
$link, $link,
$descr, $descr,
$gefVon, $gefVon,
$counter $counter,
$additionalInformation
); );
} catch (\ErrorException $e) { } catch (\ErrorException $e) {
continue; continue;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\Models\parserSkripte; namespace app\Models\parserSkripte;
use App\Models\Searchengine; use App\Models\Searchengine;
use Log;
class Opencrawlpolitik extends Searchengine class Opencrawlpolitik extends Searchengine
{ {
...@@ -29,6 +30,14 @@ class Opencrawlpolitik extends Searchengine ...@@ -29,6 +30,14 @@ class Opencrawlpolitik extends Searchengine
break; break;
} }
$dateString = $result->{"opencrawlDate"}->__toString();
$date = date_create_from_format("Ymd-Hi", $dateString);
$dateVal = $date->getTimestamp();
$additionalInformation = ['date' => $dateVal];
$title = $result->{"title"}->__toString(); $title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString(); $link = $result->{"link"}->__toString();
$anzeigeLink = $link; $anzeigeLink = $link;
...@@ -41,7 +50,8 @@ class Opencrawlpolitik extends Searchengine ...@@ -41,7 +50,8 @@ class Opencrawlpolitik extends Searchengine
$anzeigeLink, $anzeigeLink,
$descr, $descr,
$this->gefVon, $this->gefVon,
$this->counter $this->counter,
$additionalInformation
); );
$count++; $count++;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment