Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
3cdd1970
Commit
3cdd1970
authored
Sep 12, 2016
by
Karl
Browse files
Dailymotion ist jetzt als Videosuche eingefügt und funktioniert super.
parent
f3c51a11
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Dailymotion.php
0 → 100644
View file @
3cdd1970
<?php
namespace
app\Models\parserSkripte
;
use
App\Models\Searchengine
;
class
Dailymotion
extends
Searchengine
{
public
$results
=
[];
public
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
}
public
function
loadResults
(
$result
)
{
$result
=
preg_replace
(
"/
\r\n
/si"
,
""
,
$result
);
try
{
$content
=
json_decode
(
$result
);
}
catch
(
\
Exception
$e
)
{
abort
(
500
,
"
$result
is not a valid xml string"
);
}
if
(
!
$content
)
{
return
;
}
$results
=
$content
->
list
;
foreach
(
$results
as
$result
)
{
$title
=
$result
->
title
;
$link
=
$result
->
url
;
$anzeigeLink
=
$link
;
$descr
=
$result
->
description
;
$image
=
$result
->
thumbnail_240_url
;
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
,
false
,
$image
);
}
}
}
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