Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
a21f84a4
Commit
a21f84a4
authored
Feb 08, 2021
by
Dominik Hebeler
Browse files
added possibility to remove description from results
parent
c5f81451
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
a21f84a4
...
...
@@ -66,6 +66,7 @@ class MetaGer
protected
$adDomainsBlacklisted
=
[];
protected
$urlsBlacklisted
=
[];
protected
$adUrlsBlacklisted
=
[];
protected
$blacklistDescriptionUrl
=
[];
protected
$url
;
protected
$fullUrl
;
protected
$enabledSearchengines
=
[];
...
...
@@ -103,6 +104,11 @@ class MetaGer
$this
->
adUrlsBlacklisted
=
explode
(
"
\n
"
,
$tmp
);
}
if
(
file_exists
(
config_path
()
.
"/blacklistDescriptionUrl.txt"
)){
$tmp
=
file_get_contents
(
config_path
()
.
"/blacklistDescriptionUrl.txt"
);
$this
->
blacklistDescriptionUrl
=
explode
(
"
\n
"
,
$tmp
);
}
# Parser Skripte einhängen
$dir
=
app_path
()
.
"/Models/parserSkripte/"
;
foreach
(
scandir
(
$dir
)
as
$filename
)
{
...
...
@@ -1831,6 +1837,11 @@ class MetaGer
return
$this
->
domainsBlacklisted
;
}
public
function
getBlacklistDescriptionUrl
()
{
return
$this
->
blacklistDescriptionUrl
;
}
public
function
getUrlBlacklist
()
{
return
$this
->
urlsBlacklisted
;
...
...
app/Models/Result.php
View file @
a21f84a4
...
...
@@ -269,6 +269,11 @@ class Result
}
}
// Possibly remove description
if
(
$this
->
isDescriptionBlackListed
(
$metager
)){
$this
->
descr
=
""
;
}
/*
# Phrasensuche:
$text = strtolower($this->titel) . " " . strtolower($this->descr);
...
...
@@ -324,6 +329,11 @@ class Result
}
public
function
isDescriptionBlackListed
(
\
App\MetaGer
$metager
)
{
return
in_array
(
$this
->
strippedLink
,
$metager
->
getBlacklistDescriptionUrl
())
||
in_array
(
$this
->
strippedLinkAnzeige
,
$metager
->
getBlacklistDescriptionUrl
());
}
/* Liest aus einem Link den Host.
* Dieser wird dabei in die Form:
* "http://www.foo.bar.de/test?ja=1" -> "foo.bar.de"
...
...
chart/templates/deployment.yaml
View file @
a21f84a4
...
...
@@ -121,6 +121,10 @@ spec:
mountPath
:
/html/config/adBlacklistUrl.txt
subPath
:
adblacklisturl
readOnly
:
true
-
name
:
secrets
mountPath
:
/html/config/blacklistDescriptionUrl.txt
subPath
:
blacklistDescriptionUrl
readOnly
:
true
-
name
:
secrets
mountPath
:
/html/config/adBlacklistDomains.txt
subPath
:
adblacklistdomains
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment