2014-05-26 02:30:46 +04:00
|
|
|
<?php
|
2017-02-11 18:16:56 +03:00
|
|
|
class FootitoBridge extends BridgeAbstract {
|
2014-05-26 02:30:46 +04:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
const MAINTAINER = 'superbaillot.net';
|
|
|
|
const NAME = 'Footito';
|
|
|
|
const URI = 'http://www.footito.fr/';
|
|
|
|
const DESCRIPTION = 'Footito';
|
2015-11-04 01:28:44 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
public function collectData(){
|
|
|
|
$html = getSimpleHTMLDOM(self::URI)
|
|
|
|
or returnServerError('Could not request Footito.');
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-07-29 20:28:00 +03:00
|
|
|
foreach($html->find('div.post') as $element) {
|
2017-02-11 18:16:56 +03:00
|
|
|
$item = array();
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = trim($element->innertext);
|
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'<img',
|
2017-02-11 18:16:56 +03:00
|
|
|
"<img style='float : left;'",
|
|
|
|
$content );
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="logo"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='float : left;'",
|
|
|
|
$content );
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="contenu"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='margin-left : 60px;'",
|
|
|
|
$content );
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="responsive-comment"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='border-top : 1px #DDD solid; background-color : white; padding : 10px;'",
|
|
|
|
$content );
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="jaime"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='display : none;'",
|
|
|
|
$content );
|
2016-07-08 20:06:35 +03:00
|
|
|
|
2017-02-11 18:16:56 +03:00
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="auteur-event responsive"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='display : none;'",
|
|
|
|
$content );
|
|
|
|
|
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="report-abuse-button"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='display : none;'",
|
|
|
|
$content );
|
|
|
|
|
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="reaction clearfix"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='margin : 10px 0px; padding : 5px; border-bottom : 1px #DDD solid;'",
|
|
|
|
$content );
|
|
|
|
|
|
|
|
$content = str_replace(
|
2018-06-30 00:55:33 +03:00
|
|
|
'class="infos"',
|
2017-02-11 18:16:56 +03:00
|
|
|
"style='font-size : 0.7em;'",
|
|
|
|
$content );
|
|
|
|
|
|
|
|
$item['content'] = $content;
|
|
|
|
|
|
|
|
$title = $element->find('.contenu .texte ', 0)->plaintext;
|
|
|
|
$item['title'] = $title;
|
|
|
|
|
|
|
|
$info = $element->find('div.infos', 0);
|
|
|
|
|
|
|
|
$item['timestamp'] = strtotime($info->find('time', 0)->datetime);
|
|
|
|
$item['author'] = $info->find('a.auteur', 0)->plaintext;
|
|
|
|
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
2014-05-26 02:30:46 +04:00
|
|
|
}
|