Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
a21f84a4
Commit
a21f84a4
authored
Feb 08, 2021
by
Dominik Hebeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added possibility to remove description from results
parent
c5f81451
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
app/MetaGer.php
app/MetaGer.php
+11
-0
app/Models/Result.php
app/Models/Result.php
+10
-0
chart/templates/deployment.yaml
chart/templates/deployment.yaml
+4
-0
No files found.
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