Lösche Evercade News Bridge
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
class EvercadeBridge extends BridgeAbstract {
|
||||
|
||||
const MAINTAINER = 'Akamaru';
|
||||
const NAME = 'Evercade News';
|
||||
const URI = 'https://evercade.co.uk/blog';
|
||||
const CACHE_TIMEOUT = 21600; // 21600 = 6h
|
||||
const DESCRIPTION = 'All the news from Evercade and our community';
|
||||
|
||||
public function getIcon()
|
||||
{
|
||||
return 'https://www.google.com/s2/favicons?domain=evercade.co.uk&sz=32';
|
||||
}
|
||||
|
||||
public function collectData() {
|
||||
// Retrieve webpage
|
||||
$pageUrl = self::URI;
|
||||
$html = getSimpleHTMLDOM($pageUrl)
|
||||
or returnServerError('Could not request webpage: ' . $pageUrl);
|
||||
|
||||
// Process articles
|
||||
foreach($html->find('a.single-post-archive') as $element) {
|
||||
|
||||
if(count($this->items) >= 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
$article_title = trim(strip_tags($element->find('div.post-name span', 0)->innertext));
|
||||
$article_uri = $element->href;
|
||||
$article_content = '';
|
||||
if ($element->find('div.excerpt', 0)) {
|
||||
$article_content = trim(strip_tags($element->find('div.excerpt', 0)->innertext));
|
||||
}
|
||||
$article_date = '';
|
||||
if ($element->find('span.post-date', 0)) {
|
||||
$article_date = $element->find('span.post-date', 0)->innertext;
|
||||
}
|
||||
$article_author = '';
|
||||
if ($element->find('span.author-name', 0)) {
|
||||
$article_author = $element->find('span.author-name', 0)->innertext;
|
||||
}
|
||||
$article_uid = $article_title;
|
||||
|
||||
// Store article in items array
|
||||
if (!empty($article_title)) {
|
||||
$item = array();
|
||||
$item['uri'] = $article_uri;
|
||||
$item['title'] = $article_title;
|
||||
$item['content'] = $article_content;
|
||||
$item['uid'] = $article_uid;
|
||||
if (!empty($article_date)) {
|
||||
$item['timestamp'] = strtotime($article_date);
|
||||
}
|
||||
if (!empty($article_author)) {
|
||||
$item['author'] = $article_author;
|
||||
}
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,9 +51,6 @@ Diese Sammlung enthält verschiedene Bridge-Implementierungen für RSS-Bridge, u
|
||||
### [Echo Lederhacke Bridge](https://bridge.ponywave.de/#bridge-EchoLederheckeBridge) (Von Akamaru)
|
||||
- **Beschreibung**: Neue Ausgaben des Gemeindeblatts "Echo der Lederhecke" als RSS-Feed.
|
||||
|
||||
### [Evercade Bridge](https://bridge.ponywave.de/#bridge-EvercadeBridge) (Von Akamaru)
|
||||
- **Beschreibung**: Alle Neuigkeiten von Evercade und unserer Community
|
||||
|
||||
### [EverSD News Bridge](https://bridge.ponywave.de/#bridge-EverSDBridge) (Von Akamaru)
|
||||
- **Beschreibung**: EverSD News und Changelog.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user