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
e8c27df4
Commit
e8c27df4
authored
Dec 14, 2016
by
Karl
Browse files
Yandex zur sicherheit bereits absturzsicher gemacht
parent
ae633171
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Yandex.php
View file @
e8c27df4
...
...
@@ -59,24 +59,24 @@ class Yandex extends Searchengine
# Wir müssen herausfinden, ob es überhaupt noch weitere Ergebnisse von Yandex gibt:
try
{
$content
=
simplexml_load_string
(
$result
);
if
(
!
$content
)
{
return
;
}
$resultCount
=
intval
(
$content
->
xpath
(
'//yandexsearch/response/results/grouping/found[@priority="all"]'
)[
0
]
->
__toString
());
$pageLast
=
$content
->
xpath
(
'//yandexsearch/response/results/grouping/page'
)[
0
];
$pageLast
=
intval
(
$pageLast
[
"last"
]
->
__toString
());
if
(
count
(
$this
->
results
)
<=
0
||
$pageLast
>=
$resultCount
)
{
return
;
}
$next
=
new
Yandex
(
simplexml_load_string
(
$this
->
engine
),
$metager
);
$next
->
getString
.
=
"&page="
.
(
$metager
->
getPage
()
+
1
);
$next
->
hash
=
md5
(
$next
->
host
.
$next
->
getString
.
$next
->
port
.
$next
->
name
);
$this
->
next
=
$next
;
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
"Results from
$this->name
are not a valid json string"
);
return
;
}
if
(
!
$content
)
{
return
;
}
$resultCount
=
intval
(
$content
->
xpath
(
'//yandexsearch/response/results/grouping/found[@priority="all"]'
)[
0
]
->
__toString
());
$pageLast
=
$content
->
xpath
(
'//yandexsearch/response/results/grouping/page'
)[
0
];
$pageLast
=
intval
(
$pageLast
[
"last"
]
->
__toString
());
if
(
count
(
$this
->
results
)
<=
0
||
$pageLast
>=
$resultCount
)
{
return
;
}
$next
=
new
Yandex
(
simplexml_load_string
(
$this
->
engine
),
$metager
);
$next
->
getString
.
=
"&page="
.
(
$metager
->
getPage
()
+
1
);
$next
->
hash
=
md5
(
$next
->
host
.
$next
->
getString
.
$next
->
port
.
$next
->
name
);
$this
->
next
=
$next
;
}
}
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