Delete broken, unneeded bridges (#2595)

This commit is contained in:
quickwick 2022-04-03 01:10:56 -07:00 committed by GitHub
parent aa83a990d1
commit 28f5066fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 180 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}