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
bf375c43
Commit
bf375c43
authored
Jul 13, 2021
by
Dominik Hebeler
Browse files
added yacy
parent
46edc88f
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Yacy.php
View file @
bf375c43
...
...
@@ -39,7 +39,7 @@ class Yacy extends Searchengine
$this
->
engine
->
{
"display-name"
},
$this
->
engine
->
homepage
,
$this
->
counter
);
}
}
}
}
catch
(
\
Exception
$e
)
{
...
...
@@ -48,4 +48,29 @@ class Yacy extends Searchengine
return
;
}
}
public
function
getNext
(
\
App\MetaGer
$metager
,
$result
)
{
try
{
$resultCount
=
0
;
$content
=
json_decode
(
$result
,
true
);
$content
=
$content
[
"channels"
];
foreach
(
$content
as
$channel
)
{
$items
=
$channel
[
"items"
];
$resultCount
+=
sizeof
(
$items
);
}
if
(
$resultCount
>
0
){
$next
=
new
Yacy
(
$this
->
name
,
$this
->
engine
,
$metager
);
$next
->
getString
.
=
"&startRecord="
.
((
$metager
->
getPage
()
+
1
)
*
10
);
$next
->
hash
=
md5
(
$next
->
engine
->
host
.
$next
->
getString
.
$next
->
engine
->
port
.
$next
->
name
);
$this
->
next
=
$next
;
}
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
"A problem occurred parsing results from
$this->name
:"
);
Log
::
error
(
$e
->
getMessage
());
return
;
}
}
}
Write
Preview
Supports
Markdown
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