1
0
Fork 0
forked from blallo/rss-bridge

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:
logmanoriginal 2016-08-06 16:00:56 +02:00
parent f99f4d23ac
commit 1d53b70272
34 changed files with 87 additions and 145 deletions

View file

@ -10,7 +10,7 @@ class AllocineFRBridge extends BridgeAbstract{
$this->name = "Allo Cine : Faux Raccord";
$this->uri = "http://www.allocine.fr/video/programme-12284/saison-24580/";
$this->description = "Allo Cine : Faux Raccord";
$this->update = "07/11/2013";
$this->update = "2016-08-06";
}
@ -50,8 +50,5 @@ class AllocineFRBridge extends BridgeAbstract{
public function getCacheDuration(){
return 25200; // 7 hours
}
public function getDescription(){
return "Allo Cine : " . $this->_NOM . " via rss-bridge";
}
}
?>

View file

@ -10,7 +10,7 @@ class AllocineT5Bridge extends BridgeAbstract{
$this->name = "Allo Cine : Top 5";
$this->uri = "http://www.allocine.fr/video/programme-12299/saison-22542/";
$this->description = "Allo Cine : Top 5 via rss-bridge";
$this->update = "07/11/2013";
$this->update = "2016-08-06";
}
@ -50,8 +50,5 @@ class AllocineT5Bridge extends BridgeAbstract{
public function getCacheDuration(){
return 25200; // 7 hours
}
public function getDescription(){
return "Allo Cine : " . $this->_NOM . " via rss-bridge";
}
}
?>

View file

@ -10,7 +10,7 @@ class AllocineTueursEnSerieBridge extends BridgeAbstract{
$this->name = "Allo Cine : Tueurs En Serie";
$this->uri = "http://www.allocine.fr/video/programme-12286/saison-22938/";
$this->description = "Allo Cine : Tueurs En Serie";
$this->update = "12/11/2013";
$this->update = "2016-08-06";
}
@ -50,8 +50,5 @@ class AllocineTueursEnSerieBridge extends BridgeAbstract{
public function getCacheDuration(){
return 25200; // 7 hours
}
public function getDescription(){
return "Allo Cine : " . $this->_NOM . " via rss-bridge";
}
}
?>

View file

@ -7,7 +7,7 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
$this->name = "Blagues De Merde";
$this->uri = "http://www.blaguesdemerde.fr/";
$this->description = "Blagues De Merde";
$this->update = "16/10/2013";
$this->update = "2016-08-06";
}
@ -43,8 +43,5 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
public function getCacheDuration(){
return 7200; // 2h hours
}
public function getDescription(){
return "Blagues De Merde via rss-bridge";
}
}
?>

View file

@ -5,10 +5,10 @@ class CADBridge extends BridgeAbstract{
$this->name = "CAD Bridge";
$this->uri = "http://www.cad-comic.com/";
$this->description = "Returns the newest articles.";
$this->update = "2016-08-02";
$this->update = "2016-08-06";
}
function CADExtractContent($url) {
private function CADExtractContent($url) {
$html3 = $this->file_get_html($url);
// The request might fail due to missing https support or wrong URL

View file

@ -5,7 +5,7 @@ class CastorusBridge extends BridgeAbstract {
$this->name = "Castorus Bridge";
$this->uri = $this->getURI();
$this->description = "Returns the latest changes";
$this->update = "2016-08-05";
$this->update = "2016-08-06";
$this->parameters["Get latest changes"] = '[]';
$this->parameters["Get latest changes via ZIP code"] =
@ -33,7 +33,7 @@ class CastorusBridge extends BridgeAbstract {
}
// Extracts the tile from an actitiy
function ExtractActivityTitle($activity){
private function ExtractActivityTitle($activity){
$title = $activity->find('a', 0);
if(!$title)
@ -43,7 +43,7 @@ class CastorusBridge extends BridgeAbstract {
}
// Extracts the url from an actitiy
function ExtractActivityUrl($activity){
private function ExtractActivityUrl($activity){
$url = $activity->find('a', 0);
if(!$url)
@ -53,7 +53,7 @@ class CastorusBridge extends BridgeAbstract {
}
// Extracts the time from an activity
function ExtractActivityTime($activity){
private function ExtractActivityTime($activity){
// Unfortunately the time is part of the parent node,
// so we have to clear all child nodes first
$nodes = $activity->find('*');
@ -69,7 +69,7 @@ class CastorusBridge extends BridgeAbstract {
}
// Extracts the price change
function ExtractActivityPrice($activity){
private function ExtractActivityPrice($activity){
$price = $activity->find('span', 1);
if(!$price)

View file

@ -6,10 +6,10 @@ class CommonDreamsBridge extends BridgeAbstract{
$this->name = "CommonDreams Bridge";
$this->uri = "http://www.commondreams.org/";
$this->description = "Returns the newest articles.";
$this->update = "2016-08-02";
$this->update = "2016-08-06";
}
function CommonDreamsExtractContent($url) {
private function CommonDreamsExtractContent($url) {
$html3 = $this->file_get_html($url);
$text = $html3->find('div[class=field--type-text-with-summary]', 0)->innertext;
$html3->clear();

View file

@ -7,7 +7,7 @@ class CopieDoubleBridge extends BridgeAbstract{
$this->name = "CopieDouble";
$this->uri = "http://www.copie-double.com/";
$this->description = "CopieDouble";
$this->update = "12/12/2013";
$this->update = "2016-08-06";
}
@ -50,13 +50,7 @@ class CopieDoubleBridge extends BridgeAbstract{
return 'http://www.copie-double.com';
}
public function getDescription(){
return 'CopieDouble via rss-bridge';
}
public function getCacheDuration(){
return 14400; // 4 hours
}
}
?>

View file

@ -7,7 +7,7 @@ class DauphineLibereBridge extends BridgeAbstract {
$this->name = "DauphineLibereBridge Bridge";
$this->uri = "http://www.ledauphine.com/";
$this->description = "Returns the newest articles.";
$this->update = "2016-08-02";
$this->update = "2016-08-06";
$this->parameters[] =
'[
@ -81,7 +81,7 @@ class DauphineLibereBridge extends BridgeAbstract {
]';
}
function ExtractContent($url, $context) {
private function ExtractContent($url, $context) {
$html2 = $this->file_get_html($url, false, $context);
$text = $html2->find('div.column', 0)->innertext;
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);

View file

@ -6,10 +6,10 @@ class DeveloppezDotComBridge extends BridgeAbstract{
$this->name = "Developpez.com Actus (FR)";
$this->uri = "http://www.developpez.com/";
$this->description = "Returns the 15 newest posts from DeveloppezDotCom (full text).";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function DeveloppezDotComStripCDATA($string) {
private function DeveloppezDotComStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
@ -17,7 +17,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{
// F***ing quotes from Microsoft Word badly encoded, here was the trick:
// http://stackoverflow.com/questions/1262038/how-to-replace-microsoft-encoded-quotes-in-php
function convert_smart_quotes($string)
private function convert_smart_quotes($string)
{
$search = array(chr(145),
chr(146),
@ -34,7 +34,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{
return str_replace($search, $replace, $string);
}
function DeveloppezDotComExtractContent($url) {
private function DeveloppezDotComExtractContent($url) {
$articleHTMLContent = $this->file_get_html($url);
$text = $this->convert_smart_quotes($articleHTMLContent->find('div.content', 0)->innertext);
$text = utf8_encode($text);

View file

@ -6,8 +6,8 @@ class DilbertBridge extends BridgeAbstract {
$this->maintainer = 'kranack';
$this->name = $this->getName();
$this->uri = $this->getURI();
$this->description = $this->getDescription();
$this->update = "14/05/2016";
$this->description = 'The Unofficial Dilbert Daily Comic Strip';
$this->update = "2016-08-06";
}
@ -46,10 +46,6 @@ class DilbertBridge extends BridgeAbstract {
return 'http://dilbert.com';
}
public function getDescription() {
return 'The Unofficial Dilbert Daily Comic Strip';
}
public function getCacheDuration() {
return 21600; // 6 hours
}

View file

@ -6,7 +6,7 @@ class ElsevierBridge extends BridgeAbstract{
$this->name = 'Elsevier journals recent articles';
$this->uri = 'http://www.journals.elsevier.com';
$this->description = 'Returns the recent articles published in Elsevier journals';
$this->update = '2016-08-02';
$this->update = '2016-08-06';
$this->parameters[] =
'[
@ -21,7 +21,7 @@ class ElsevierBridge extends BridgeAbstract{
}
// Extracts the list of names from an article as string
function ExtractArticleName ($article){
private function ExtractArticleName ($article){
$names = $article->find('small', 0);
if($names)
return trim($names->plaintext);
@ -29,7 +29,7 @@ class ElsevierBridge extends BridgeAbstract{
}
// Extracts the timestamp from an article
function ExtractArticleTimestamp ($article){
private function ExtractArticleTimestamp ($article){
$time = $article->find('.article-info', 0);
if($time){
$timestring = trim($time->plaintext);
@ -53,7 +53,7 @@ class ElsevierBridge extends BridgeAbstract{
}
// Extracts the content from an article
function ExtractArticleContent ($article){
private function ExtractArticleContent ($article){
$content = $article->find('.article-content', 0);
if($content){
return trim($content->plaintext);

View file

@ -5,8 +5,8 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
$this->maintainer = 'ORelio';
$this->name = $this->getName();
$this->uri = $this->getURI();
$this->description = $this->getDescription();
$this->update = "02/07/2016";
$this->description = 'Should we put a website in production today? (French)';
$this->update = "2016-08-06";
}
public function collectData(array $param) {
@ -45,10 +45,6 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
return 'https://www.estcequonmetenprodaujourdhui.info/';
}
public function getDescription() {
return 'Should we put a website in production today? (French)';
}
public function getCacheDuration() {
return 21600; // 6 hours
}

View file

@ -7,7 +7,7 @@ class FootitoBridge extends BridgeAbstract{
$this->name = "Footito";
$this->uri = "http://www.footito.fr/";
$this->description = "Footito";
$this->update = "21/11/2013";
$this->update = "2016-08-06";
}
@ -53,8 +53,4 @@ class FootitoBridge extends BridgeAbstract{
public function getCacheDuration(){
return 3600; // 1h hours
}
public function getDescription(){
return "Footito via rss-bridge";
}
}
?>

View file

@ -9,7 +9,7 @@ class GBAtempBridge extends BridgeAbstract {
$this->name = 'GBAtemp';
$this->uri = $this->getURI();
$this->description = 'GBAtemp is a user friendly underground video game community.';
$this->update = '2016-08-02';
$this->update = '2016-08-06';
$this->parameters[] =
'[
@ -40,7 +40,7 @@ class GBAtempBridge extends BridgeAbstract {
]';
}
function ExtractFromDelimiters($string, $start, $end) {
private function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
$section_retrieved = substr($string, strpos($string, $start) + strlen($start));
$section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));
@ -48,7 +48,7 @@ class GBAtempBridge extends BridgeAbstract {
} return false;
}
function StripWithDelimiters($string, $start, $end) {
private function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
$section_to_remove = substr($string, strpos($string, $start));
$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
@ -56,7 +56,7 @@ class GBAtempBridge extends BridgeAbstract {
} return $string;
}
function build_item($uri, $title, $author, $timestamp, $thumnail, $content) {
private function build_item($uri, $title, $author, $timestamp, $thumnail, $content) {
$item = new \Item();
$item->uri = $uri;
$item->title = $title;
@ -67,14 +67,14 @@ class GBAtempBridge extends BridgeAbstract {
return $item;
}
function cleanup_post_content($content, $site_url) {
private function cleanup_post_content($content, $site_url) {
$content = str_replace(':arrow:', '&#x27a4;', $content);
$content = str_replace('href="attachments/', 'href="'.$site_url.'attachments/', $content);
$content = $this->StripWithDelimiters($content, '<script', '</script>');
return $content;
}
function fetch_post_content($uri, $site_url) {
private function fetch_post_content($uri, $site_url) {
$html = $this->file_get_html($uri) or $this->returnError('Could not request GBAtemp: '.$uri, 500);
$content = $html->find('div.messageContent', 0)->innertext;
return $this->cleanup_post_content($content, $site_url);

View file

@ -9,7 +9,7 @@ class GiphyBridge extends BridgeAbstract{
$this->name = "Giphy Bridge";
$this->uri = "http://giphy.com/";
$this->description = "Bridge for giphy.com";
$this->update = "2014-12-05";
$this->update = "2016-08-06";
$this->parameters["By tag"] =
'[
@ -92,8 +92,4 @@ class GiphyBridge extends BridgeAbstract{
public function getCacheDuration(){
return 300; // 5 minutes
}
public function getUsername(){
return $this->items[0]->username;
}
}

View file

@ -6,10 +6,10 @@ class GuruMedBridge extends BridgeAbstract{
$this->name = "GuruMed";
$this->uri = "http://www.gurumed.org";
$this->description = "Returns the 5 newest posts from Gurumed (full text)";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function GurumedStripCDATA($string) {
private function GurumedStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;

View file

@ -7,7 +7,7 @@ class HentaiHavenBridge extends BridgeAbstract{
$this->name = "Hentai Haven";
$this->uri = "http://hentaihaven.org/";
$this->description = "Returns releases from Hentai Haven";
$this->update = "2015-01-16";
$this->update = "2016-08-06";
}
@ -29,9 +29,6 @@ class HentaiHavenBridge extends BridgeAbstract{
public function getURI(){
return '';
}
public function getDescription(){
return "Hentai Haven | Everything Else is Irrelevant";
}
public function getCacheDuration(){
return 21600; // 6 hours
}

View file

@ -6,16 +6,16 @@ class KoreusBridge extends BridgeAbstract{
$this->name = "Koreus";
$this->uri = "http://www.koreus.com/";
$this->description = "Returns the 5 newest posts from Koreus (full text)";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function KoreusStripCDATA($string) {
private function KoreusStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
function KoreusExtractContent($url) {
private function KoreusExtractContent($url) {
$html2 = $this->file_get_html($url);
$text = $html2->find('p[class=itemText]', 0)->innertext;
$text = utf8_encode(preg_replace('/(Sur le m.+?)+$/i','',$text));

View file

@ -6,16 +6,16 @@ class LeJournalDuGeekBridge extends BridgeAbstract{
$this->name = "journaldugeek.com (FR)";
$this->uri = "http://www.journaldugeek.com/";
$this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text).";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function LeJournalDuGeekStripCDATA($string) {
private function LeJournalDuGeekStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
function LeJournalDuGeekExtractContent($url) {
private function LeJournalDuGeekExtractContent($url) {
$articleHTMLContent = $this->file_get_html($url);
$text = $articleHTMLContent->find('div.post-content', 0)->innertext;

View file

@ -7,7 +7,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
$this->name = "Les Joies Du Code";
$this->uri = "http://lesjoiesducode.fr/";
$this->description = "LesJoiesDuCode";
$this->update = "04/02/2015";
$this->update = "2016-08-06";
}
@ -59,8 +59,4 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
public function getCacheDuration(){
return 7200; // 2h hours
}
public function getDescription(){
return "Les Joies Du Code via rss-bridge";
}
}
?>

View file

@ -6,10 +6,10 @@ class MsnMondeBridge extends BridgeAbstract{
$this->name = "MSN Actu Monde";
$this->uri = "http://www.msn.com/fr-fr/actualite/monde";
$this->description = "Returns the 10 newest posts from MSN Actualités (full text)";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function MsnMondeExtractContent($url, &$item) {
private function MsnMondeExtractContent($url, &$item) {
$html2 = $this->file_get_html($url);
$item->content = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext;
$item->timestamp = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);

View file

@ -6,16 +6,16 @@ class NextInpactBridge extends BridgeAbstract {
$this->name = "NextInpact Bridge";
$this->uri = "http://www.nextinpact.com/";
$this->description = "Returns the newest articles.";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function StripCDATA($string) {
private function StripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
function ExtractContent($url) {
private function ExtractContent($url) {
$html2 = $this->file_get_html($url);
$text = '<p><em>'.$html2->find('span.sub_title', 0)->innertext.'</em></p>'
.'<p><img src="'.$html2->find('div.container_main_image_article', 0)->find('img.dedicated',0)->src.'" alt="-" /></p>'

View file

@ -6,10 +6,10 @@ class NiceMatinBridge extends BridgeAbstract{
$this->name = "NiceMatin";
$this->uri = "http://www.nicematin.com/";
$this->description = "Returns the 10 newest posts from NiceMatin (full text)";
$this->update = "2016-08-03";
$this->update = "2016-08-06";
}
function NiceMatinExtractContent($url) {
private function NiceMatinExtractContent($url) {
$html = $this->file_get_html($url);
if(!$html)
$this->returnError('Could not acquire content from url: ' . $url . '!', 404);

View file

@ -7,7 +7,7 @@ class NovelUpdatesBridge extends BridgeAbstract{
$this->name = "Novel Updates";
$this->uri = "http://www.novelupdates.com/";
$this->description = "Returns releases from Novel Updates";
$this->update = "2016-05-21";
$this->update = "2016-08-06";
$this->parameters[] =
'[
{
@ -50,9 +50,6 @@ class NovelUpdatesBridge extends BridgeAbstract{
public function getURI(){
return 'http://www.novelupdates.com/';
}
public function getDescription(){
return "Novel Updates - Directory of Translated Novels";
}
public function getCacheDuration(){
return 21600; // 6 hours
}

View file

@ -6,10 +6,10 @@ class PlanetLibreBridge extends BridgeAbstract{
$this->name = "PlanetLibre";
$this->uri = "http://www.planet-libre.org";
$this->description = "Returns the 5 newest posts from PlanetLibre (full text)";
$this->update = "2016-08-04";
$this->update = "2016-08-06";
}
function PlanetLibreExtractContent($url){
private function PlanetLibreExtractContent($url){
$html2 = $this->file_get_html($url);
$text = $html2->find('div[class="post-text"]', 0)->innertext;
return $text;

View file

@ -6,10 +6,10 @@ class ReporterreBridge extends BridgeAbstract{
$this->name = "Reporterre Bridge";
$this->uri = "http://www.reporterre.net/";
$this->description = "Returns the newest articles.";
$this->update = "2016-08-04";
$this->update = "2016-08-06";
}
function ExtractContentReporterre($url) {
private function ExtractContentReporterre($url) {
$html2 = $this->file_get_html($url);
foreach($html2->find('div[style=text-align:justify]') as $e) {

View file

@ -8,7 +8,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->name = "Sens Critique";
$this->uri = "http://www.senscritique.com";
$this->description = "Sens Critique news";
$this->update = "2016-07-29";
$this->update = "2016-08-06";
$this->parameters[] =
'[
@ -63,7 +63,7 @@ class SensCritiqueBridge extends BridgeAbstract {
}
}
public function collectMoviesData() {
private function collectMoviesData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/films/cette-semaine') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -71,7 +71,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function collectSeriesData() {
private function collectSeriesData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/series/actualite') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -79,7 +79,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function collectGamesData() {
private function collectGamesData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/jeuxvideo/actualite') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -87,7 +87,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function collectBooksData() {
private function collectBooksData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/livres/actualite') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -95,7 +95,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function collectBDsData() {
private function collectBDsData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/bd/actualite') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -103,7 +103,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function collectMusicsData() {
private function collectMusicsData() {
$html = '';
$html = $this->file_get_html('http://www.senscritique.com/musique/actualite') or $this->returnError('No results for this query.', 404);
$list = $html->find('ul.elpr-list', 0);
@ -111,7 +111,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->extractDataFromList($list);
}
public function extractDataFromList($list) {
private function extractDataFromList($list) {
if ($list === null) {
$this->returnError('Cannot extract data from list', 400);
}

View file

@ -8,7 +8,7 @@ class Sexactu extends BridgeAbstract{
$this->name = "Sexactu";
$this->uri = "http://www.gqmagazine.fr";
$this->description = "Sexactu via rss-bridge";
$this->update = "04/02/2014";
$this->update = "2016-08-06";
}
@ -69,11 +69,8 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July',
public function getCacheDuration(){
return 7200; // 2h hours
}
public function getDescription(){
return "Sexactu via rss-bridge";
}
public function correctCase($str) {
private function correctCase($str) {
$sentences=explode('.', mb_strtolower($str, "UTF-8"));
$str="";
$sep="";

View file

@ -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">

View file

@ -7,7 +7,7 @@ class TheCodingLoveBridge extends BridgeAbstract{
$this->name = "The Coding Love";
$this->uri = "http://thecodinglove.com/";
$this->description = "The Coding Love";
$this->update = "04/02/2015";
$this->update = "2016-08-06";
}
@ -60,8 +60,4 @@ class TheCodingLoveBridge extends BridgeAbstract{
public function getCacheDuration(){
return 7200; // 2h hours
}
public function getDescription(){
return "The Coding Love via rss-bridge";
}
}
?>

View file

@ -7,7 +7,7 @@ class TwitterBridgeTweaked extends BridgeAbstract{
$this->name = "Twitter Bridge Tweaked";
$this->uri = "https://twitter.com/";
$this->description = "(same as Twitter Bridge Extended, but with cleaned title & content)";
$this->update = "2014-12-05";
$this->update = "2016-08-06";
$this->parameters["By keyword or hashtag"] =
'[
@ -158,8 +158,4 @@ class TwitterBridgeTweaked extends BridgeAbstract{
public function getCacheDuration(){
return 300; // 5 minutes
}
public function getUsername(){
return $this->items[0]->username;
}
}

View file

@ -12,7 +12,7 @@ class WordPressBridge extends BridgeAbstract {
$this->name = "Wordpress Bridge";
$this->uri = "https://wordpress.org/";
$this->description = "Returns the 3 newest full posts of a Wordpress blog";
$this->update = "2016-08-04";
$this->update = "2016-08-06";
$this->parameters[] =
'[
@ -25,7 +25,7 @@ class WordPressBridge extends BridgeAbstract {
}
// Returns the content type for a given html dom
function DetectContentType($html){
private function DetectContentType($html){
if($html->find('entry'))
return WORDPRESS_TYPE_ATOM;
if($html->find('item'))
@ -34,7 +34,7 @@ class WordPressBridge extends BridgeAbstract {
}
// Replaces all 'link' tags with 'url' for simplehtmldom to actually find 'links' ('url')
function ReplaceLinkTagsWithUrlTags($element){
private function ReplaceLinkTagsWithUrlTags($element){
// We need to fix the 'link' tag as simplehtmldom cannot parse it (just rename it and load back as dom)
$element_text = $element->outertext;
$element_text = str_replace('<link>', '<url>', $element_text);
@ -43,13 +43,13 @@ class WordPressBridge extends BridgeAbstract {
return str_get_html($element_text);
}
function StripCDATA($string) {
private function StripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
$string = str_replace(']]>', '', $string);
return $string;
}
function ClearContent($content) {
private function ClearContent($content) {
$content = preg_replace('/<script[^>]*>[^<]*<\/script>/', '', $content);
$content = preg_replace('/<div class="wpa".*/', '', $content);
$content = preg_replace('/<form.*\/form>/', '', $content);

View file

@ -12,7 +12,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
$this->name = "World of Tanks";
$this->uri = "http://worldoftanks.eu/";
$this->description = "News about the tank slaughter game.";
$this->update = "2015-09-12";
$this->update = "2016-08-06";
$this->parameters[] =
'[
@ -79,7 +79,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
}
}
public function parseLine($infoLink) {
private function parseLine($infoLink) {
$item = new Item();
$item->uri = WORLD_OF_TANKS.$infoLink->href;
// now load that uri from cache
@ -105,7 +105,4 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
public function getCacheDuration(){
return 3600; // 2h hours
}
public function getDescription(){
return "Toutes les actualités les plus brulantes de ce simulateur de destruction d'acier.";
}
}