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
6a69daa8
Commit
6a69daa8
authored
Aug 09, 2016
by
Dominik Hebeler
Browse files
Ein Fehler in Exalead repariert
parent
711c7398
Changes
1
Show whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Exalead.php
View file @
6a69daa8
...
@@ -15,6 +15,7 @@ class Exalead extends Searchengine
...
@@ -15,6 +15,7 @@ class Exalead extends Searchengine
public
function
loadResults
(
$result
)
public
function
loadResults
(
$result
)
{
{
# die($result);
$result
=
preg_replace
(
"/
\r\n
/si"
,
""
,
$result
);
$result
=
preg_replace
(
"/
\r\n
/si"
,
""
,
$result
);
try
{
try
{
$content
=
simplexml_load_string
(
$result
);
$content
=
simplexml_load_string
(
$result
);
...
@@ -50,9 +51,15 @@ class Exalead extends Searchengine
...
@@ -50,9 +51,15 @@ class Exalead extends Searchengine
$title
=
$result
->
xpath
(
"a:metas/a:Meta[@name='title']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$title
=
$result
->
xpath
(
"a:metas/a:Meta[@name='title']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$link
=
$result
->
xpath
(
"a:metas/a:Meta[@name='url']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$link
=
$result
->
xpath
(
"a:metas/a:Meta[@name='url']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$anzeigeLink
=
$link
;
$anzeigeLink
=
$link
;
if
(
sizeOf
(
$result
->
xpath
(
"a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']"
))
===
0
)
$descr
=
""
;
$descr
=
""
;
else
if
(
sizeOf
(
$result
->
xpath
(
"a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']"
))
===
0
&&
sizeOf
(
$result
->
xpath
(
"a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']"
))
!==
0
)
{
$tmp
=
$result
->
xpath
(
"a:metas/a:Meta[@name='summary']/a:MetaText[@name='value']"
);
foreach
(
$tmp
as
$el
)
{
$descr
.
=
strip_tags
(
$el
->
asXML
());
}
}
else
$descr
=
$result
->
xpath
(
"a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$descr
=
$result
->
xpath
(
"a:metas/a:Meta[@name='metadesc']/a:MetaString[@name='value']"
)[
0
]
->
__toString
();
$this
->
counter
++
;
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
results
[]
=
new
\
App\Models\Result
(
...
...
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