Skip to content
Snippets Groups Projects
Commit 8b70c4d2 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Updated branch

parents 97986331 56cadcfb
No related branches found
No related tags found
3 merge requests!1895Development,!1747Development,!1731Resolve "removing integration of obsolete resultpage formats"
......@@ -33,6 +33,8 @@ stages:
- integrationtest
- cleanup
.auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.6"
build:
services:
......@@ -163,4 +165,4 @@ integrationtest:
- sed -i "s#^APP_URL=.*#APP_URL=$URL#g" .env
- sed -i "s#^BRANCH_NAME=.*#BRANCH_NAME=$CI_COMMIT_REF_NAME#g" .env
- sed -i "s#^COMMIT_NAME=.*#COMMIT_NAME=$CI_COMMIT_REF_SLUG#g" .env
- php artisan dusk
\ No newline at end of file
- php artisan dusk
postgresql:
enabled: false
service:
externalPort: 80
internalPort: 80
......
postgresql:
enabled: false
service:
externalPort: 80
internalPort: 80
......
---
postgresql:
enabled: false
hpa:
enabled: false
ingress:
......@@ -20,4 +21,4 @@ service:
commonName: ""
externalPort: 80
internalPort: 80
deploymentApiVersion: apps/v1
deploymentApiVersion: apps/v1
\ No newline at end of file
......@@ -245,11 +245,11 @@ class MetaGerSearch extends Controller
$newResults = 0;
foreach ($metager->getResults() as $index => $resultTmp) {
if ($resultTmp->new || $resultTmp->adgoalChanged) {
if ($resultTmp->new || $resultTmp->changed) {
if ($metager->getFokus() !== "bilder") {
$view = View::make('layouts.result', ['index' => $index, 'result' => $resultTmp, 'metager' => $metager]);
$html = $view->render();
if (!$resultTmp->new && $resultTmp->adgoalChanged) {
if (!$resultTmp->new && $resultTmp->changed) {
$result['changedResults'][$index] = $html;
} else {
$result['newResults'][$index] = $html;
......@@ -258,7 +258,7 @@ class MetaGerSearch extends Controller
} else {
$view = View::make('layouts.image_result', ['index' => $index, 'result' => $resultTmp, 'metager' => $metager]);
$html = $view->render();
if (!$resultTmp->new && $resultTmp->adgoalChanged) {
if (!$resultTmp->new && $resultTmp->changed) {
$result['changedResults'][$index] = $html;
} else {
$result['newResults'][$index] = $html;
......
......@@ -277,6 +277,11 @@ class MetaGer
if (!empty($timings)) {
$timings["prepareResults"]["validated results"] = microtime(true) - $timings["starttime"];
}
$this->duplicationCheck();
if(!empty($timings)){
$timings["prepareResults"]["duplications checked"] = microtime(true) - $timings["starttime"];
}
# Validate Advertisements
$newResults = [];
foreach ($this->ads as $ad) {
......@@ -379,6 +384,42 @@ class MetaGer
}
}
public function duplicationCheck()
{
$arr = [];
for($i = 0; $i < count($this->results); $i++) {
$link = $this->results[$i]->link;
if (strpos($link, "http://") === 0) {
$link = substr($link, 7);
}
if (strpos($link, "https://") === 0) {
$link = substr($link, 8);
}
if (strpos($link, "www.") === 0) {
$link = substr($link, 4);
}
$link = trim($link, "/");
$hash = md5($link);
if(isset($arr[$link])){
$arr[$link]->gefVon[] = $this->results[$i]->gefVon[0];
$arr[$link]->gefVonLink[] = $this->results[$i]->gefVonLink[0];
array_splice($this->results, $i, 1);
$i--;
if($arr[$link]->new === true || $this->results[$i]->new === true){
$arr[$link]->changed = true;
}
}else{
$arr[$link] = &$this->results[$i];
}
}
}
public function startAdgoal(&$results)
{
$publicKey = getenv('adgoal_public');
......@@ -485,7 +526,7 @@ class MetaGer
$newLink = "https://api.smartredirect.de/api_v2/ClickGate.php?p=" . urlencode($publicKey) . "&k=" . urlencode($gateHash) . "&url=" . urlencode($targetUrl) . "&q=" . urlencode($query);
$result->link = $newLink;
$result->partnershop = true;
$result->adgoalChanged = true;
$result->changed = true;
}
}
}
......
......@@ -13,8 +13,8 @@ class Result
public $anzeigeLink; # Der tatsächlich angezeigte Link (rein optisch)
public $descr; # Die eventuell gekürzte Beschreibung des Suchergebnisses
public $longDescr; # Die ungekürzte Beschreibung des Suchergebnisses
public $gefVon; # Die Suchmaschine von der dieses Ergebnis stammt
public $gefVonLink;
public $gefVon = []; # Die Suchmaschine von der dieses Ergebnis stammt
public $gefVonLink = [];
public $sourceRank; # Das Ranking für dieses Suchergebnis von der Seite, die es geliefert hat (implizit durch Ergebnisreihenfolge: 20 - Position in Ergebnisliste)
public $partnershop; # Ist das Ergebnis von einem Partnershop? (bool)
public $image; # Ein Vorschaubild für das Suchergebnis (als URL)
......@@ -31,7 +31,7 @@ class Result
public $strippedLinkAnzeige; # Der Link in Form "foo.bar.de/test"
public $rank; # Das Ranking für das Ergebnis
public $new = true;
public $adgoalChanged = false;
public $changed = false;
# Erstellt ein neues Ergebnis
public function __construct($provider, $titel, $link, $anzeigeLink, $descr, $gefVon, $gefVonLink, $sourceRank, $additionalInformation = [])
......@@ -49,8 +49,8 @@ class Result
$this->descr = substr($this->descr, 0, strpos($this->descr, "\n"));
$this->descr .= "&#8230;"; // Ellipsis character
}
$this->gefVon = trim($gefVon);
$this->gefVonLink = trim($gefVonLink);
$this->gefVon[] = trim($gefVon);
$this->gefVonLink[] = trim($gefVonLink);
$this->proxyLink = $this->generateProxyLink($this->link);
$this->sourceRank = $sourceRank;
if ($this->sourceRank <= 0 || $this->sourceRank > 20) {
......@@ -115,7 +115,7 @@ class Result
}
# Runter Ranken von Yandex Ergebnissen mit zu viel kyrillischen Texten
if (stripos($this->gefVon, "yandex") !== false) {
if (stripos($this->gefVon[0], "yandex") !== false) {
$rank -= $this->calcYandexBoost($eingabe);
}
......@@ -279,7 +279,7 @@ class Result
/* Der Dublettenfilter, der sicher stellt,
* dass wir nach Möglichkeit keinen Link doppelt in der Ergebnisliste haben.
*/
$dublettenLink = $this->strippedLink;
if (!empty($this->provider->{"dubletten-include-parameter"}) && sizeof($this->provider->{"dubletten-include-parameter"}) > 0) {
$dublettenLink .= "?";
......@@ -300,12 +300,13 @@ class Result
}
}
if ($metager->addLink($dublettenLink)) {
if ($metager->addLink($this)) {
$metager->addHostCount($this->strippedHost);
return true;
} else {
return false;
}
}*/
return true;
}
public function isBlackListed(\App\MetaGer $metager)
......
dependencies:
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com/
repository: https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive
version: 0.7.1
digest: sha256:358ce85fe4d3461ea6bb96713470a80de9c1324214a2e6f97d800298c02530e2
generated: 2017-08-28T15:22:30.690341342-05:00
digest: sha256:0a7e2f279e3b8063cfe6365a56601227ff8934fa70a0434df0485bce9590be56
generated: "2020-10-21T09:35:20.464079556+07:00"
dependencies:
# This is a legacy in-cluster PostgreSQL dependency that is no longer used for newer installations.
# We can remove this dependency when we drop support for the legacy instances.
- name: postgresql
version: "0.7.1"
repository: "https://kubernetes-charts.storage.googleapis.com/"
repository: "@stable-archive"
condition: postgresql.enabled
......@@ -13,5 +13,6 @@ return [
'options.more' => 'MEHR',
'options.less' => 'WENIGER',
'gefVon' => 'von',
'providers' => 'Anbietern',
'proxytext' => 'Der Link wird anonymisiert geöffnet. Ihre Daten werden nicht zum Zielserver übertragen. Möglicherweise funktionieren manche Webseiten nicht wie gewohnt.',
];
......@@ -13,5 +13,6 @@ return [
'options.more' => 'MORE',
'options.less' => 'LESS',
'gefVon' => 'by',
'providers' => 'providers',
'proxytext' => 'Result link is opened anonymously. Your data will not be transferred to destination servers. Some webpages may not work as usual.'
];
\ No newline at end of file
......@@ -8,7 +8,7 @@
{{ $ad->titel }}
</a>
</h2>
<a class="ad-label" href="{{ $ad->gefVonLink }}" target="_blank" rel="noopener">{!! $ad->gefVon !!}</a>
<a class="ad-label" href="{{ $ad->gefVonLink[0] }}" target="_blank" rel="noopener">{!! $ad->gefVon[0] !!}</a>
</div>
<div class="result-subheadline">
<a class="result-link" href="{{ $ad->link }}" target="{{ $metager->getNewtab() }}" tabindex="-1">
......
@if(isset($ad))
<ad:advertisement>
<ad:callOut type="TEXT">{!! trans('ad.werbung') !!} {!! trans('ad.von') !!} {!! $ad->gefVon !!}</ad:callOut>
<ad:callOut type="TEXT">{!! trans('ad.werbung') !!} {!! trans('ad.von') !!} {!! $ad->gefVon[0] !!}</ad:callOut>
<ad:title type="TEXT">{{ $ad->titel }}</ad:title>
<ad:displayUrl type="TEXT">{{ $ad->anzeigeLink }}</ad:displayUrl>
<ad:subTitle type="TEXT">{{ $ad->descr }}</ad:subTitle>
......
......@@ -2,7 +2,7 @@
<a href="{{ $result->link }}" target="_blank">
<div title="{{ $result->titel }}">
<img src="{{ $metager->getImageProxyLink($result->image)}}" alt="{{ $result->titel }}"/>
<div>{{ $result->gefVon }}</div>
<div>{{ $result->gefVon[0] }}</div>
</div>
</a>
</div>
......@@ -9,7 +9,11 @@
{!! $result->titel !!}
</a>
</h2>
<a class="result-hoster" href="{{ $result->gefVonLink }}" target="{{ $metager->getNewtab() }}" rel="noopener" tabindex="-1">{{ trans('result.gefVon') . " " . $result->gefVon }} </a>
@if(sizeof($result->gefVon)===1)
<a class="result-hoster" href="{{ $result->gefVonLink[0] }}" target="{{ $metager->getNewtab() }}" rel="noopener" tabindex="-1">{{ trans('result.gefVon') . " " . $result->gefVon[0] }} </a>
@else
<span title="{{ (implode(', ', $result->gefVon)) }}" class="result-hoster"> {{ trans('result.gefVon') . " " . sizeof($result->gefVon) . " " . trans('result.providers') }} </span>
@endif
</div>
<div class="result-subheadline">
<a class="result-link" href="{{ $result->link }}" title="{{ $result->anzeigeLink }}" rel="noopener" tabindex="-1">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment