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