1st Upload

This commit is contained in:
Akamaru 2023-08-11 22:09:51 +02:00
commit 079498163a
7 changed files with 331 additions and 0 deletions

56
AnimessoBridge.php Normal file
View File

@ -0,0 +1,56 @@
<?php
class AnimessoBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = '[Test] Animes.so Search Results';
const URI = 'https://www.animes.so/';
const CACHE_TIMEOUT = 21600; // 21600 = 6h
const DESCRIPTION = 'Get search results from Animes.so';
const PARAMETERS = array(array(
'id' => array(
'name' => 'Search ID',
'required' => true,
'exampleValue' => '6681897'
),
));
public function getIcon(){
return 'https://cdn.animes.so/styles/animesso/logo.og.png';
}
public function collectData() {
$id = $this->getInput('id');
// Retrieve webpage
$pageUrl = self::URI . 'suche/' . $id . '//?o=date&c[title_only]=1';
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('div.listBlock.main') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim($element->find('h3', 0)->innertext);
//$article_thumbnail = $element->find('a', 0)->data-thumbnailurl;
$article_uri = $element->find('h3 a', 0)->href;
//$article_content = '<img src="'. $article_thumbnail .'"><br>';
$article_content = trim(strip_tags($element->find('blockquote.snippet', 0)->innertext));
$article_uid = trim(strip_tags($element->find('h3', 0)->innertext));
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = self::URI . $article_uri;
$item['title'] = $article_title;
//$item['enclosures'] = array($article_thumbnail);
$item['content'] = $article_content;
$item['uid'] = $article_uid;
$this->items[] = $item;
}
}
}
}

48
EvercadeBridge.php Normal file
View File

@ -0,0 +1,48 @@
<?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://evercade.co.uk/wp-content/themes/evercade/img/icons/favicon.ico';
}
public function collectData() {
// Retrieve webpage
$pageUrl = self::URI;
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('div.an-article') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim(strip_tags($element->find('h2', 0)->innertext));
$article_uri = substr($element->find('a', 0)->href, 0);
//$article_thumbnail = self::URI . substr($element->find('img', 0)->src, 3);
//$article_content = '<img src="'. $article_thumbnail .'"></a>';
$article_content = trim(strip_tags($element->find('p.excerpt', 0)->innertext));
//$article_timestamp = strtotime($element->find('time', 0)->attr['datetime']);
$article_uid = trim(strip_tags($element->find('h2', 0)->innertext));
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = $article_uri;
$item['title'] = $article_title;
//$item['enclosures'] = array($article_thumbnail);
$item['content'] = $article_content;
//$item['timestamp'] = $article_timestamp;
$item['uid'] = $article_uid;
$this->items[] = $item;
}
}
}
}

48
FoodwatchBridge.php Normal file
View File

@ -0,0 +1,48 @@
<?php
class FoodwatchBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = 'Foodwatch.org News';
const URI = 'https://www.foodwatch.org';
const CACHE_TIMEOUT = 21600; // 21600 = 6h
const DESCRIPTION = 'Get the latest news from Foodwatch.org.';
public function getIcon(){
return 'https://www.foodwatch.org/typo3conf/ext/wwt3_site/Resources/Public/Images/Favicons/favicon.ico';
}
public function collectData() {
// Retrieve webpage
$pageUrl = self::URI . '/de/informieren/aktuelle-nachrichten/';
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('div.list-teaser__content') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim(strip_tags($element->find('h3', 0)->innertext));
$article_uri = self::URI . substr($element->find('a', 0)->href, 0);
//$article_thumbnail = self::URI . substr($element->find('img', 0)->src, 3);
//$article_content = '<img src="'. $article_thumbnail .'"></a>';
$article_content = trim(strip_tags($element->find('div.list-teaser__main', 0)->innertext));
//$article_timestamp = strtotime($element->find('time', 0)->attr['datetime']);
$article_uid = trim(strip_tags($element->find('div.list-teaser__meta', 0)->innertext));
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = $article_uri;
$item['title'] = $article_title;
//$item['enclosures'] = array($article_thumbnail);
$item['content'] = $article_content;
//$item['timestamp'] = $article_timestamp;
$item['uid'] = $article_uid;
$this->items[] = $item;
}
}
}
}

48
KAZENewsBridge.php Normal file
View File

@ -0,0 +1,48 @@
<?php
class KAZENewsBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = 'KAZÉ News';
const URI = 'https://www.kaze-online.de';
const CACHE_TIMEOUT = 21600; // 21600 = 6h
const DESCRIPTION = 'Get the latest news from KAZÉ-Anime.';
public function getIcon(){
return 'https://www.kaze-online.de/media/d5/d7/ce/1622636185/logo.svg';
}
public function collectData() {
// Retrieve webpage
$pageUrl = self::URI . '/news';
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('div.kaze-news-list__item') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim(strip_tags($element->find('div.kaze-news-list-item__title', 0)->innertext));
$article_uri = self::URI . substr($element->find('a', 0)->href, 0);
$article_thumbnail = substr($element->find('img', 0)->src, 0);
//$article_content = '<img src="'. $article_thumbnail .'"></a>';
$article_content = trim(strip_tags($element->find('div.kaze-news-list-item__descr', 0)->innertext));
//$article_timestamp = strtotime($element->find('time', 0)->attr['datetime']);
$article_uid = trim(strip_tags($element->find('span.kaze-news-list-item__date', 0)->innertext));
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = $article_uri;
$item['title'] = $article_title;
$item['enclosures'] = array($article_thumbnail);
$item['content'] = $article_content;
//$item['timestamp'] = $article_timestamp;
$item['uid'] = $article_uid;
$this->items[] = $item;
}
}
}
}

View File

@ -0,0 +1,40 @@
<?php
class KemonoFriendsMusicNewsBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = 'Kemono Friends Music News';
const URI = 'https://www.jvcmusic.co.jp/kemono-friends/';
const CACHE_TIMEOUT = 1; // 21600 = 6h
const DESCRIPTION = 'Get the latest news for Kemono Friends Music.';
public function collectData() {
// Retrieve webpage
$pageUrl = self::URI;
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('ul.l_newslink li') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim(strip_tags($element->find('p.newslink_txt', 0)->innertext));
$article_uri = self::URI . substr($element->find('a', 0)->href, 0);
// strtotime() doesn't seem to like the missing zeroes in the month
$article_time = trim(strip_tags($element->find('div.newslink_date', 0)->innertext));
$article_timestamp = date_format(date_create_from_format("Y.m.d", $article_time), "d.m.Y");
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = $article_uri;
$item['title'] = $article_title;
$item['timestamp'] = $article_timestamp;
$this->items[] = $item;
}
}
}
}

43
ThumbzillaFeedBridge.php Normal file
View File

@ -0,0 +1,43 @@
<?php
class ThumbzillaFeedBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = 'Thumbzilla Feed';
const URI = 'https://www.thumbzilla.com';
const CACHE_TIMEOUT = 21600; // 21600 = 6h
const DESCRIPTION = 'Get the latest Videos from Thumbzilla.';
public function getIcon(){
return 'https://ci.phncdn.com/www-static/thumbzilla/images/favicon.ico';
}
public function collectData() {
// Retrieve webpage
$pageUrl = self::URI . '/newest';
$html = getSimpleHTMLDOM($pageUrl)
or returnServerError('Could not request webpage: ' . $pageUrl);
// Process articles
foreach($html->find('a.js-thumb') as $element) {
if(count($this->items) >= 10) {
break;
}
$article_title = trim(strip_tags($element->find('span.title', 0)->innertext));
$article_thumbnail = substr($element->find('img', 0)->src, 0);
$article_content = '<img src="'. $article_thumbnail .'"></a>';
$article_uid = trim(strip_tags($element->find('span.title', 0)->innertext));
// Store article in items array
if (!empty($article_title)) {
$item = array();
$item['uri'] = $pageUrl;
$item['title'] = $article_title;
$item['content'] = $article_content;
$item['uid'] = $article_uid;
$this->items[] = $item;
}
}
}
}

View File

@ -0,0 +1,48 @@
<?php
class Y2MateDownloaderBridge extends BridgeAbstract {
const MAINTAINER = 'Akamaru';
const NAME = 'Y2Mate Downloader Changelog';
const URI = 'https://y2mate.ch/de/y2mate-downloader-changelog';
const CACHE_TIMEOUT = 3600; // 1 hour
const DESCRIPTION = 'Changelog for Y2Mate Downloader';
public function collectData() {
$html = getSimpleHTMLDOM(self::URI)
or returnServerError('Could not load content');
// Extract article title
$articleTitle = $html->find('h2.title.tc', 0)->innertext;
$edition = $html->find('p.edition.tc', 0)->innertext;
$articleTitle = $articleTitle . ' ' . $edition;
// Extract article content
$articleContent = $html->find('div.list', 0)->innertext;
// Extract release date
$releaseDate = $html->find('p.tc.time', 0)->innertext;
$releaseDate = str_replace('Freigegeben am', '', $releaseDate);
// Extract article uid
$articleUid = $edition;
// Build the item
$item = array();
$item['uri'] = self::URI;
$item['title'] = $articleTitle;
$item['timestamp'] = strtotime($releaseDate);
$item['content'] = $articleContent;
$item['uid'] = $articleUid;
// Add the item to the feed
$this->items[] = $item;
}
public function getName() {
return self::NAME;
}
public function getURI() {
return self::URI;
}
}