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
de375c5e
Commit
de375c5e
authored
May 10, 2017
by
Dominik Hebeler
Browse files
Merge branch '485-ux-bei-such-timeout' into 'development'
Yacy repariert Closes
#485
See merge request
!852
parents
eae87b38
8967fab7
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Models/Searchengine.php
View file @
de375c5e
...
...
@@ -122,7 +122,11 @@ abstract class Searchengine
}
else
{
$url
=
"http://"
;
}
$url
.
=
$this
->
host
.
$this
->
getString
;
$url
.
=
$this
->
host
;
if
(
$this
->
port
!==
80
&&
$this
->
port
!==
443
){
$url
.
=
":"
.
$this
->
port
;
}
$url
.
=
$this
->
getString
;
$url
=
base64_encode
(
$url
);
$mission
=
$this
->
resultHash
.
";"
.
$url
.
";"
.
$metager
->
getTime
();
// Submit this mission to the corresponding Redis Queue
...
...
app/Models/parserSkripte/Yacy.php
View file @
de375c5e
...
...
@@ -16,34 +16,31 @@ class Yacy extends Searchengine
public
function
loadResults
(
$result
)
{
$result
=
preg_replace
(
"/
\r\n
/si"
,
""
,
$result
);
try
{
$content
=
simplexml_load_string
(
$result
);
if
(
!
$content
)
{
return
;
}
$results
=
$content
->
xpath
(
"//rss/channel/item"
);
if
(
!
$results
)
{
return
;
}
foreach
(
$results
as
$res
)
{
$title
=
$res
->
{
"title"
};
$link
=
$res
->
{
"link"
};
$anzeigeLink
=
$link
;
$descr
=
$res
->
{
"description"
};
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
);
$content
=
json_decode
(
$result
,
true
);
$content
=
$content
[
"channels"
];
foreach
(
$content
as
$channel
){
$items
=
$channel
[
"items"
];
foreach
(
$items
as
$item
){
$title
=
$item
[
"title"
];
$link
=
$item
[
"link"
];
$anzeigeLink
=
$link
;
$descr
=
$item
[
"description"
];
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
);
}
}
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
"A problem occurred parsing results from
$this->name
:"
);
...
...
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