diff options
-rw-r--r-- | bridges/ABCTabsBridge.php | 42 | ||||
-rw-r--r-- | bridges/LichessBridge.php | 31 | ||||
-rw-r--r-- | bridges/SupInfoBridge.php | 57 | ||||
-rw-r--r-- | bridges/WosckerBridge.php | 50 |
4 files changed, 0 insertions, 180 deletions
diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php deleted file mode 100644 index ef2c75b1..00000000 --- a/bridges/ABCTabsBridge.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -class ABCTabsBridge extends BridgeAbstract { - - const MAINTAINER = 'kranack'; - const NAME = 'ABC Tabs Bridge'; - const URI = 'https://www.abc-tabs.com/'; - const DESCRIPTION = 'Returns 22 newest tabs'; - - public function collectData(){ - $html = ''; - $html = getSimpleHTMLDOM(static::URI . 'tablatures/nouveautes.html') - or returnClientError('No results for this query.'); - - $table = $html->find('table#myTable', 0)->children(1); - - foreach ($table->find('tr') as $tab) { - $item = array(); - $item['author'] = $tab->find('td', 1)->plaintext - . ' - ' - . $tab->find('td', 2)->plaintext; - - $item['title'] = $tab->find('td', 1)->plaintext - . ' - ' - . $tab->find('td', 2)->plaintext; - - $item['content'] = 'Le ' - . $tab->find('td', 0)->plaintext - . '<br> Par: ' - . $tab->find('td', 5)->plaintext - . '<br> Type: ' - . $tab->find('td', 3)->plaintext; - - $item['id'] = static::URI - . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); - - $item['uri'] = static::URI - . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); - - $this->items[] = $item; - } - } -} diff --git a/bridges/LichessBridge.php b/bridges/LichessBridge.php deleted file mode 100644 index bf7369fb..00000000 --- a/bridges/LichessBridge.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -class LichessBridge extends FeedExpander { - - const MAINTAINER = 'AmauryCarrade'; - const NAME = 'Lichess Blog'; - const URI = 'http://fr.lichess.org/blog'; - const DESCRIPTION = 'Returns the 5 newest posts from the Lichess blog (full text)'; - - public function collectData(){ - $this->collectExpandableDatas(self::URI . '.atom', 5); - } - - protected function parseItem($newsItem){ - $item = parent::parseItem($newsItem); - $item['content'] = $this->retrieveLichessPost($item['uri']); - return $item; - } - - private function retrieveLichessPost($blog_post_uri){ - $blog_post_html = getSimpleHTMLDOMCached($blog_post_uri); - $blog_post_div = $blog_post_html->find('#lichess_blog', 0); - - $post_chapo = $blog_post_div->find('.shortlede', 0)->innertext; - $post_content = $blog_post_div->find('.body', 0)->innertext; - - $content = '<p><em>' . $post_chapo . '</em></p>'; - $content .= '<div>' . $post_content . '</div>'; - - return $content; - } -} diff --git a/bridges/SupInfoBridge.php b/bridges/SupInfoBridge.php deleted file mode 100644 index a2b9fc0b..00000000 --- a/bridges/SupInfoBridge.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -class SupInfoBridge extends BridgeAbstract { - - const MAINTAINER = 'teromene'; - const NAME = 'SupInfoBridge'; - const URI = 'https://www.supinfo.com'; - const DESCRIPTION = 'Returns the newest articles.'; - - const PARAMETERS = array(array( - 'tag' => array( - 'name' => 'Category (not mandatory)', - 'type' => 'text', - ) - )); - - public function getIcon() { - return self::URI . '/favicon.png'; - } - - public function collectData() { - - if(empty($this->getInput('tag'))) { - $html = getSimpleHTMLDOM(self::URI . '/articles/'); - } else { - $html = getSimpleHTMLDOM(self::URI . '/articles/tag/' . $this->getInput('tag')); - } - $content = $html->find('#latest', 0)->find('ul[class=courseContent]', 0); - - for($i = 0; $i < 5; $i++) { - - $this->items[] = $this->fetchArticle($content->find('h4', $i)->find('a', 0)->href); - - } - } - - private function fetchArticle($link) { - - $articleHTML = getSimpleHTMLDOM(self::URI . $link); - - $article = $articleHTML->find('div[id=courseDocZero]', 0); - $item = array(); - $item['author'] = $article->find('#courseMetas', 0)->find('a', 0)->plaintext; - $item['id'] = $link; - $item['uri'] = self::URI . $link; - $item['title'] = $article->find('h1', 0)->plaintext; - $date = explode(' ', $article->find('#courseMetas', 0)->find('span', 1)->plaintext); - $item['timestamp'] = DateTime::createFromFormat('d/m/Y H:i:s', $date[2] . ' ' . $date[4])->getTimestamp(); - - $article->find('div[id=courseHeader]', 0)->innertext = ''; - $article->find('div[id=author-infos]', 0)->innertext = ''; - $article->find('div[id=cartouche-tete]', 0)->innertext = ''; - $item['content'] = $article; - - return $item; - - } -} diff --git a/bridges/WosckerBridge.php b/bridges/WosckerBridge.php deleted file mode 100644 index 694f69b1..00000000 --- a/bridges/WosckerBridge.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -class WosckerBridge extends BridgeAbstract { - const NAME = 'Woscker Bridge'; - const URI = 'https://woscker.com/'; - const DESCRIPTION = 'Returns news of the day'; - const MAINTAINER = 'VerifiedJoseph'; - const PARAMETERS = array(); - - const CACHE_TIMEOUT = 1800; // 30 mins - - public function collectData() { - $html = getSimpleHTMLDOM($this->getURI()); - - $date = $html->find('h1', 0)->plaintext; - $timestamp = $html->find('span.dateFont', 0)->plaintext . ' ' . $html->find('span.dateFont', 1)->plaintext; - - $item = array(); - $item['title'] = $date; - $item['content'] = $this->formatContent($html); - $item['timestamp'] = $timestamp; - - $this->items[] = $item; - } - - private function formatContent($html) { - $html->find('h1', 0)->outertext = ''; - - foreach ($html->find('hr') as $hr) { - $hr->outertext = ''; - } - - foreach ($html->find('div.betweenHeadline') as $div) { - $div->outertext = ''; - } - - foreach ($html->find('div.dividingBarrier') as $div) { - $div->outertext = ''; - } - - foreach ($html->find('h2') as $h2) { - $h2->outertext = '<br><strong>' . $h2->innertext . '</strong><br>'; - } - - foreach ($html->find('h3') as $h3) { - $h3->outertext = $h3->innertext . '<br>'; - } - - return $html->find('div.fullContentPiece', 0)->innertext; - } -} |