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
$descr .= $description->__toString();
}
$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();
if (isset($providerCounter[$provider]) && $providerCounter[$provider] > 10) {
......@@ -67,7 +76,8 @@ class Minisucher extends Searchengine
$link,
$descr,
$gefVon,
$counter
$counter,
$additionalInformation
);
} catch (\ErrorException $e) {
continue;
......
......@@ -3,6 +3,7 @@
namespace app\Models\parserSkripte;
use App\Models\Searchengine;
use Log;
class Opencrawlpolitik extends Searchengine
{
......@@ -29,6 +30,14 @@ class Opencrawlpolitik extends Searchengine
break;
}
$dateString = $result->{"opencrawlDate"}->__toString();
$date = date_create_from_format("Ymd-Hi", $dateString);
$dateVal = $date->getTimestamp();
$additionalInformation = ['date' => $dateVal];
$title = $result->{"title"}->__toString();
$link = $result->{"link"}->__toString();
$anzeigeLink = $link;
......@@ -41,7 +50,8 @@ class Opencrawlpolitik extends Searchengine
$anzeigeLink,
$descr,
$this->gefVon,
$this->counter
$this->counter,
$additionalInformation
);
$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