mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-28 10:30:12 +02:00
bridges: Remove unused functions and update scopes
Many bridges implemented getDescription() which is only applicable for bridges extending RSSExpander. Functions that are not part of the abstract class or interface should be in private scope for better readability.
This commit is contained in:
@@ -5,11 +5,11 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
$this->name = $this->getName();
|
||||
$this->uri = $this->getURI();
|
||||
$this->description = 'Returns a list of anime from the current Season Anime List';
|
||||
$this->update = '2016-08-04';
|
||||
$this->update = '2016-08-06';
|
||||
}
|
||||
|
||||
// Returns an html object for the Season Anime List (latest season)
|
||||
function LoadSeasonAnimeList(){
|
||||
private function LoadSeasonAnimeList(){
|
||||
// First we need to find the URI to the latest season from the 'seasons' page searching for 'Season Anime List'
|
||||
$html = $this->file_get_html($this->getURI() . '/seasons');
|
||||
if(!$html)
|
||||
@@ -27,7 +27,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the anime title
|
||||
function ExtractAnimeTitle($anime){
|
||||
private function ExtractAnimeTitle($anime){
|
||||
$title = $anime->find('a', 0);
|
||||
if(!$title)
|
||||
$this->returnError('Could not find anime title!', 404);
|
||||
@@ -35,7 +35,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the anime URI
|
||||
function ExtractAnimeURI($anime){
|
||||
private function ExtractAnimeURI($anime){
|
||||
$uri = $anime->find('a', 0);
|
||||
if(!$uri)
|
||||
$this->returnError('Could not find anime URI!', 404);
|
||||
@@ -43,7 +43,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the anime release date (timestamp)
|
||||
function ExtractAnimeTimestamp($anime){
|
||||
private function ExtractAnimeTimestamp($anime){
|
||||
$timestamp = $anime->find('span.header_info_block', 1);
|
||||
if(!$timestamp)
|
||||
$this->returnError('Could not find anime timestamp!', 404);
|
||||
@@ -51,7 +51,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the anime studio name (author)
|
||||
function ExtractAnimeAuthor($anime){
|
||||
private function ExtractAnimeAuthor($anime){
|
||||
$author = $anime->find('span.header_info_block', 2);
|
||||
if(!$author)
|
||||
return; // Sometimes the studio is unknown, so leave empty
|
||||
@@ -59,7 +59,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the episode information (x of y released)
|
||||
function ExtractAnimeEpisodeInformation($anime){
|
||||
private function ExtractAnimeEpisodeInformation($anime){
|
||||
$episode = $anime->find('div.header_info_episode', 0);
|
||||
if(!$episode)
|
||||
$this->returnError('Could not find anime episode information!', 404);
|
||||
@@ -67,7 +67,7 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Extracts the background image
|
||||
function ExtractAnimeBackgroundImage($anime){
|
||||
private function ExtractAnimeBackgroundImage($anime){
|
||||
// Getting the picture is a little bit tricky as it is part of the style.
|
||||
// Luckily the style is part of the parent div :)
|
||||
|
||||
@@ -78,12 +78,12 @@ class ShanaprojectBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
// Builds an URI to search for a specific anime (subber is left empty)
|
||||
function BuildAnimeSearchURI($anime){
|
||||
private function BuildAnimeSearchURI($anime){
|
||||
return $this->getURI() . '/search/?title=' . urlencode($this->ExtractAnimeTitle($anime)) . '&subber=';
|
||||
}
|
||||
|
||||
// Builds the content string for a given anime
|
||||
function BuildAnimeContent($anime){
|
||||
private function BuildAnimeContent($anime){
|
||||
// We'll use a template string to place our contents
|
||||
return '<a href="' . $this->ExtractAnimeURI($anime) . '">
|
||||
<img src="http://' . $this->ExtractAnimeBackgroundImage($anime) . '" alt="' . htmlspecialchars($this->ExtractAnimeTitle($anime)) . '" style="border: 1px solid black">
|
||||
|
Reference in New Issue
Block a user