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
4aa9600d
Commit
4aa9600d
authored
Jun 15, 2016
by
Dominik Hebeler
Browse files
Einige fehlende Suchmaschinen hinzugefügt
parent
a3652779
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Models/parserSkripte/Beammachine.php
0 → 100644
View file @
4aa9600d
<?php
namespace
app\Models\parserSkripte
;
use
App\Models\Searchengine
;
class
Beammachine
extends
Searchengine
{
public
$results
=
[];
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
}
public
function
loadResults
(
$result
)
{
$results
=
trim
(
$result
);
foreach
(
explode
(
"
\n
"
,
$results
)
as
$result
)
{
$res
=
explode
(
"|"
,
$result
);
if
(
sizeof
(
$res
)
<
3
)
{
continue
;
}
$title
=
$res
[
0
];
$link
=
$res
[
1
];
$anzeigeLink
=
$link
;
$descr
=
$res
[
2
];
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
);
}
}
}
app/Models/parserSkripte/Dart.php
0 → 100644
View file @
4aa9600d
<?php
namespace
app\Models\parserSkripte
;
use
App\Models\Searchengine
;
use
Symfony\Component\DomCrawler\Crawler
;
class
Dart
extends
Searchengine
{
public
$results
=
[];
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
}
public
function
loadResults
(
$result
)
{
$crawler
=
new
Crawler
(
$result
);
$crawler
->
filter
(
'table#search-results > tr > td'
)
->
each
(
function
(
Crawler
$node
,
$i
)
{
$i
=
$i
-
(
6
*
$this
->
counter
);
if
(
$i
===
0
)
return
;
if
(
$i
===
1
)
{
$this
->
description
=
$node
->
text
();
$this
->
link
=
"http://www.dart-europe.eu/"
.
$node
->
filter
(
'a'
)
->
attr
(
'href'
);
}
if
(
$i
===
2
)
$this
->
title
=
$node
->
text
();
if
(
$i
===
3
)
$this
->
title
.
=
" ("
.
$node
->
text
()
.
")"
;
if
(
$i
===
4
)
$this
->
title
.
=
" "
.
$node
->
text
();
if
(
$i
===
5
)
{
$this
->
title
.
=
"|"
.
$node
->
text
();
$title
=
$this
->
title
;
$this
->
title
=
""
;
$link
=
$this
->
link
;
$this
->
link
=
""
;
$anzeigeLink
=
$link
;
$descr
=
$this
->
description
;
$this
->
description
=
""
;
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
);
}
}
);
}
}
app/Models/parserSkripte/Goyax.php
View file @
4aa9600d
...
...
@@ -2,33 +2,27 @@
namespace
app\Models\parserSkripte
;
use
App\Models\Searchengine
;
use
Symfony\Component\DomCrawler\Crawler
;
class
Goyax
extends
Searchengine
{
public
$results
=
[];
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
}
public
function
loadResults
(
$result
)
{
die
(
$result
);
$results
=
trim
(
$result
);
foreach
(
explode
(
"
\n
"
,
$results
)
as
$result
)
$crawler
=
new
Crawler
(
$result
);
$crawler
->
filter
(
'tr.treffer'
)
->
each
(
function
(
Crawler
$node
,
$i
)
{
$res
=
explode
(
"|"
,
$result
);
if
(
sizeof
(
$res
)
<
3
)
{
continue
;
}
$title
=
$res
[
0
];
$link
=
$res
[
2
];
$title
=
$node
->
filter
(
'td.name'
)
->
text
();
$link
=
"http://www.goyax.de"
.
$node
->
filter
(
'td.name > a'
)
->
attr
(
'href'
);
$anzeigeLink
=
$link
;
$descr
=
$res
[
1
]
;
$descr
=
"Aktie: "
.
$node
->
filter
(
'td.waehrung'
)
->
text
()
.
" "
.
$node
->
filter
(
'td.isin'
)
->
text
()
;
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
...
...
@@ -39,9 +33,10 @@ class Goyax extends Searchengine
$descr
,
$this
->
gefVon
,
$this
->
counter
);
}
);
}
);
}
}
\ No newline at end of file
}
app/Models/parserSkripte/Loklak.php
0 → 100644
View file @
4aa9600d
<?php
namespace
app\Models\parserSkripte
;
use
App\Models\Searchengine
;
use
Log
;
class
Loklak
extends
Searchengine
{
public
$results
=
[];
function
__construct
(
\
SimpleXMLElement
$engine
,
\
App\MetaGer
$metager
)
{
parent
::
__construct
(
$engine
,
$metager
);
}
public
function
loadResults
(
$result
)
{
if
(
!
$result
)
{
return
;
}
$results
=
json_decode
(
$result
,
true
);
if
(
!
isset
(
$results
[
'statuses'
])
)
return
;
foreach
(
$results
[
'statuses'
]
as
$result
)
{
$title
=
$result
[
"screen_name"
];
$link
=
$result
[
'link'
];
$anzeigeLink
=
$link
;
$descr
=
$result
[
"text"
];
$this
->
counter
++
;
$this
->
results
[]
=
new
\
App\Models\Result
(
$this
->
engine
,
$title
,
$link
,
$anzeigeLink
,
$descr
,
$this
->
gefVon
,
$this
->
counter
);
}
}
}
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