diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php
index f0973b6a..7481f3a1 100644
--- a/bridges/ABCTabsBridge.php
+++ b/bridges/ABCTabsBridge.php
@@ -1,19 +1,18 @@
maintainer = "kranack";
+ $this->name = "ABC Tabs Bridge";
+ $this->uri = "http://www.abc-tabs.com/";
+ $this->description = "Returns 22 newest tabs";
+ $this->update = "2014-07-23";
+
+ }
+
public function collectData(array $param){
$html = '';
$html = file_get_html('http://www.abc-tabs.com/tablatures/nouveautes.html') or $this->returnError('No results for this query.', 404);
@@ -30,12 +29,17 @@ class ABCTabsBridge extends BridgeAbstract{
$this->items[] = $item;
}
}
- public function getName(){
- return 'ABC Tabs Bridge';
+
+ public function getName() {
+
+ return "ABC Tabs Bridge";
+
}
- public function getURI(){
- return 'http://www.abc-tabs.com/';
+ public function getURI() {
+
+ return "http://www.abc-tabs.com/";
+
}
public function getCacheDuration(){
diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php
index d50a0d66..d0f5abfc 100644
--- a/bridges/AcrimedBridge.php
+++ b/bridges/AcrimedBridge.php
@@ -1,13 +1,6 @@
maintainer = "qwertygc";
@@ -46,6 +39,17 @@ class AcrimedBridge extends BridgeAbstract{
}
+ public function getName() {
+
+ return "Acrimed Bridge";
+
+ }
+
+ public function getURI() {
+
+ return "http://www.acrimed.org/";
+
+ }
public function getCacheDuration(){
return 3600*2; // 2 hours
diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php
index 976240fe..0b84ff39 100644
--- a/bridges/BastaBridge.php
+++ b/bridges/BastaBridge.php
@@ -1,16 +1,17 @@
maintainer = "qwertygc";
+ $this->name = "Bastamag Bridge";
+ $this->uri = "http://www.bastamag.net/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2014-05-25";
+
+ }
+
+
public function collectData(array $param){
diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php
index c7caed6f..2ba230f9 100644
--- a/bridges/BlaguesDeMerdeBridge.php
+++ b/bridges/BlaguesDeMerdeBridge.php
@@ -1,14 +1,16 @@
maintainer = "superbaillot.net";
+ $this->name = "Blagues De Merde";
+ $this->uri = "http://www.blaguesdemerde.fr/";
+ $this->description = "Blagues De Merde";
+ $this->update = "16/10/2013";
+
+ }
+
public function collectData(array $param){
$html = file_get_html('http://www.blaguesdemerde.fr/') or $this->returnError('Could not request BDM.', 404);
diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php
index 8238eaf9..28ef697e 100644
--- a/bridges/CADBridge.php
+++ b/bridges/CADBridge.php
@@ -1,16 +1,16 @@
maintainer = "nyutag";
+ $this->name = "CAD Bridge";
+ $this->uri = "http://www.cad-comic.com/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2015-04-03";
+
+ }
+
public function collectData(array $param){
function CADUrl($string) {
diff --git a/bridges/CoinDeskBridge.php b/bridges/CoinDeskBridge.php
index 6dc5a090..79c30ebd 100644
--- a/bridges/CoinDeskBridge.php
+++ b/bridges/CoinDeskBridge.php
@@ -1,16 +1,16 @@
maintainer = "mitsukarenai";
+ $this->name = "CoinDesk";
+ $this->uri = "http://www.coindesk.com/";
+ $this->description = "Returns the 5 newest posts from CoinDesk (full text)";
+ $this->update = "2014-05-30";
+
+ }
+
public function collectData(array $param){
function CoinDeskStripCDATA($string) {
diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php
index 6526eaea..e9e0dbc0 100644
--- a/bridges/CollegeDeFranceBridge.php
+++ b/bridges/CollegeDeFranceBridge.php
@@ -1,15 +1,16 @@
maintainer = "pit-fgfjiudghdf";
+ $this->name = "CollegeDeFrance";
+ $this->uri = "http://www.college-de-france.fr/";
+ $this->description = "Returns the 10 newest posts from CollegeDeFrance";
+ $this->update = "2014-05-26";
+
+ }
+
public function collectData(array $param){
$find = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'novembre', 'décembre');
$replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php
index 07247e56..2a30f37e 100644
--- a/bridges/CommonDreamsBridge.php
+++ b/bridges/CommonDreamsBridge.php
@@ -1,16 +1,16 @@
maintainer = "nyutag";
+ $this->name = "CommonDreams Bridge";
+ $this->uri = "http://www.commondreams.org/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2015-04-03";
+
+ }
+
public function collectData(array $param){
function CommonDreamsUrl($string) {
diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php
index c163bf6b..12b3a8a9 100644
--- a/bridges/CopieDoubleBridge.php
+++ b/bridges/CopieDoubleBridge.php
@@ -1,14 +1,17 @@
maintainer = "superbaillot.net";
+ $this->name = "CopieDouble";
+ $this->uri = "http://www.copie-double.com/";
+ $this->description = "CopieDouble";
+ $this->update = "12/12/2013";
+
+ }
+
+
public function collectData(array $param){
$html = file_get_html('http://www.copie-double.com/') or $this->returnError('Could not request CopieDouble.', 404);
$table = $html->find('table table', 2);
diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php
index 2ad5899d..a7ff8b03 100644
--- a/bridges/CourrierInternationalBridge.php
+++ b/bridges/CourrierInternationalBridge.php
@@ -1,15 +1,16 @@
maintainer = "teromene";
+ $this->name = "CourrierInternational";
+ $this->uri = "http://CourrierInternational.fr/";
+ $this->description = "Courrier International bridge";
+ $this->update = "01/09/2015";
+
+ }
+
public function collectData(array $param){
function fetchArticle($link) {
diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php
index 7e2e69e0..95a1cf5a 100644
--- a/bridges/DansTonChatBridge.php
+++ b/bridges/DansTonChatBridge.php
@@ -1,17 +1,16 @@
maintainer = "Astalaseven";
+ $this->name = "DansTonChat Bridge";
+ $this->uri = "http://danstonchat.com/latest.html";
+ $this->description = "Returns latest quotes from DansTonChat.";
+ $this->update = "2014-05-25";
+
+ }
+
public function collectData(array $param){
$html = '';
$link = 'http://danstonchat.com/latest.html';
diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php
index df38be6b..24cd3891 100644
--- a/bridges/DemoBridge.php
+++ b/bridges/DemoBridge.php
@@ -1,15 +1,4 @@
maintainer = "polopollo";
+ $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 = "2014-07-14";
+
+ }
+
public function collectData(array $param){
function DeveloppezDotComStripCDATA($string) {
diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php
index d56986c2..30cbb1c6 100644
--- a/bridges/DilbertBridge.php
+++ b/bridges/DilbertBridge.php
@@ -1,15 +1,16 @@
maintainer = "kranack";
+ $this->name = "Dilbert Daily Strip";
+ $this->uri = "http://dilbert.com/strips/";
+ $this->description = "The Unofficial Dilbert Daily Comic Strip";
+ $this->update = "30/01/2015";
+
+ }
+
public function collectData(array $param){
$html = file_get_html('http://dilbert.com/strips/') or $this->returnError('Could not request Dilbert.', 404);
diff --git a/bridges/FSBridge.php b/bridges/FSBridge.php
index bc550133..11334d52 100644
--- a/bridges/FSBridge.php
+++ b/bridges/FSBridge.php
@@ -1,19 +1,15 @@
maintainer = "qwertygc";
+ $this->name = "Futurasciences";
+ $this->uri = "http://www.futura-sciences.com";
+ $this->description = "Returns the 5 newest posts from FS (full text)";
+ $this->update = "03/11/2015";
-
+ }
public function collectData(array $param){
diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php
index 2731d5c7..467f0429 100644
--- a/bridges/FootitoBridge.php
+++ b/bridges/FootitoBridge.php
@@ -1,14 +1,16 @@
maintainer = "superbaillot.net";
+ $this->name = "Footito";
+ $this->uri = "http://www.footito.fr/";
+ $this->description = "Footito";
+ $this->update = "21/11/2013";
+
+ }
+
public function collectData(array $param){
$html = file_get_html('http://www.footito.fr/') or $this->returnError('Could not request Footito.', 404);
diff --git a/bridges/FrandroidBridge.php b/bridges/FrandroidBridge.php
index 7ee6c9c9..80aac5db 100644
--- a/bridges/FrandroidBridge.php
+++ b/bridges/FrandroidBridge.php
@@ -1,16 +1,15 @@
maintainer = "Daiyousei";
+ $this->name = "Frandroid";
+ $this->uri = "http://www.frandroid.com/";
+ $this->description = "Returns the RSS feed from Frandroid (full text articles)";
+ $this->update = "2015-03-05";
+
+ }
public function collectData(array $param)
{
diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php
index b0a4f899..f3c0d99b 100644
--- a/bridges/GiphyBridge.php
+++ b/bridges/GiphyBridge.php
@@ -12,7 +12,7 @@
* @use2(n="max number of returned items")
*/
-define(GIPHY_LIMIT, 10);
+define('GIPHY_LIMIT', 10);
class GiphyBridge extends BridgeAbstract{
diff --git a/bridges/GizmodoFRBridge.php b/bridges/GizmodoFRBridge.php
index b2e8a21e..bb19fc3d 100644
--- a/bridges/GizmodoFRBridge.php
+++ b/bridges/GizmodoFRBridge.php
@@ -1,16 +1,16 @@
maintainer = "polopollo";
+ $this->name = "GizmodoFR";
+ $this->uri = "http://www.gizmodo.fr/";
+ $this->description = "Returns the 15 newest posts from GizmodoFR (full text).";
+ $this->update = "2014-07-14";
+
+ }
+
public function collectData(array $param){
function GizmodoFRExtractContent($url) {
diff --git a/bridges/GuruMedBridge.php b/bridges/GuruMedBridge.php
index 032148bd..de836cb3 100644
--- a/bridges/GuruMedBridge.php
+++ b/bridges/GuruMedBridge.php
@@ -1,18 +1,15 @@
maintainer = "qwertygc";
+ $this->name = "GuruMed";
+ $this->uri = "http://www.gurumed.org";
+ $this->description = "Returns the 5 newest posts from Gurumed (full text)";
+ $this->update = "03/10/2015";
-
+ }
public function collectData(array $param){
diff --git a/bridges/KoreusBridge.php b/bridges/KoreusBridge.php
index 8ae90e8a..af99bf20 100644
--- a/bridges/KoreusBridge.php
+++ b/bridges/KoreusBridge.php
@@ -1,16 +1,16 @@
maintainer = "pit-fgfjiudghdf";
+ $this->name = "Koreus";
+ $this->uri = "http://www.koreus.com/";
+ $this->description = "Returns the 5 newest posts from Koreus (full text)";
+ $this->update = "2014-05-26";
+
+ }
+
public function collectData(array $param){
function KoreusStripCDATA($string) {
diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php
index 07559012..5ed3b5e5 100644
--- a/bridges/LeJournalDuGeekBridge.php
+++ b/bridges/LeJournalDuGeekBridge.php
@@ -1,16 +1,16 @@
maintainer = "polopollo";
+ $this->name = "journaldugeek.com (FR)";
+ $this->uri = "http://www.journaldugeek.com/";
+ $this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text).";
+ $this->update = "2014-07-14";
+
+ }
+
public function collectData(array $param){
function LeJournalDuGeekStripCDATA($string) {
diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php
index f007fb01..a0c16b2b 100644
--- a/bridges/LeMondeInformatiqueBridge.php
+++ b/bridges/LeMondeInformatiqueBridge.php
@@ -1,17 +1,16 @@
maintainer = "ORelio";
+ $this->name = "Le Monde Informatique";
+ $this->uri = "http://www.lemondeinformatique.fr/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2015-09-08";
+
+ }
+
public function collectData(array $param) {
function StripCDATA($string) {
diff --git a/bridges/LeMotDuJourBridge.php b/bridges/LeMotDuJourBridge.php
index 9149449b..8ea8ee61 100644
--- a/bridges/LeMotDuJourBridge.php
+++ b/bridges/LeMotDuJourBridge.php
@@ -1,12 +1,15 @@
maintainer = "qwertygc";
+ $this->name = "LeMotDuJour Bridge";
+ $this->uri = "http://www.lemotdujour.com/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2014-05-25";
+
+ }
public function collectData(array $param){
diff --git a/bridges/Les400Culs.php b/bridges/Les400Culs.php
index f01e3646..4694f406 100644
--- a/bridges/Les400Culs.php
+++ b/bridges/Les400Culs.php
@@ -1,21 +1,26 @@
maintainer = "unknown";
+ $this->name = "Les 400 Culs";
+ $this->uri = "http://sexes.blogs.liberation.fr";
+ $this->description = "La planète sexe vue par Agnès Girard via rss-bridge";
+ $this->update = "20/02/2014";
+
+ }
+
+
public function collectData(array $param){
- $param['url'] = RSS;
+ $param['url'] = SEXE_FEED;
parent::collectData($param);
}
diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php
index d9cc0028..2dd1c44b 100644
--- a/bridges/LesJoiesDuCodeBridge.php
+++ b/bridges/LesJoiesDuCodeBridge.php
@@ -1,14 +1,16 @@
maintainer = "superbaillot.net";
+ $this->name = "Les Joies Du Code";
+ $this->uri = "http://lesjoiesducode.fr/";
+ $this->description = "LesJoiesDuCode";
+ $this->update = "04/02/2015";
+
+ }
+
public function collectData(array $param){
$html = file_get_html('http://lesjoiesducode.fr/') or $this->returnError('Could not request LesJoiesDuCode.', 404);
diff --git a/bridges/MalikiBridge.php b/bridges/MalikiBridge.php
index 29e4cfa5..de871200 100644
--- a/bridges/MalikiBridge.php
+++ b/bridges/MalikiBridge.php
@@ -1,16 +1,16 @@
maintainer = "mitsukarenai";
+ $this->name = "Maliki";
+ $this->uri = "http://www.maliki.com/";
+ $this->description = "Returns Maliki's newest strips";
+ $this->update = "2014-05-30";
+
+ }
+
public function collectData(array $param){
$html = file_get_html('http://www.maliki.com/') or $this->returnError('Could not request Maliki.', 404);
$count=0;
diff --git a/bridges/MemoLinuxBridge.php b/bridges/MemoLinuxBridge.php
index 7da5ba0f..02d7ac70 100644
--- a/bridges/MemoLinuxBridge.php
+++ b/bridges/MemoLinuxBridge.php
@@ -1,13 +1,16 @@
maintainer = "qwertygc";
+ $this->name = "MemoLinux";
+ $this->uri = "http://memo-linux.com/";
+ $this->description = "Returns the 10 newest posts from MemoLinux (full text)";
+ $this->update = "2015-01-30";
+
+ }
+
public function collectData(array $param){
function StripCDATA($string) {
diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php
index 2077205e..3774be86 100644
--- a/bridges/MondeDiploBridge.php
+++ b/bridges/MondeDiploBridge.php
@@ -1,18 +1,16 @@
maintainer = "Pitchoule";
+ $this->name = "MondeDiplo";
+ $this->uri = "http://www.monde-diplomatique.fr";
+ $this->description = "Returns most recent results from MondeDiplo.";
+ $this->update = "2014-07-22";
+
+ }
+
public function collectData(array $param){
$link = 'http://www.monde-diplomatique.fr';
diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php
index 0d2e4711..1a63da63 100644
--- a/bridges/MsnMondeBridge.php
+++ b/bridges/MsnMondeBridge.php
@@ -1,16 +1,16 @@
maintainer = "kranack";
+ $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 = "2015-01-30";
+
+ }
+
public function collectData(array $param){
function MsnMondeExtractContent($url, &$item) {
diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php
index f3f76209..63c8c93e 100644
--- a/bridges/NasaApodBridge.php
+++ b/bridges/NasaApodBridge.php
@@ -1,13 +1,16 @@
maintainer = "corenting";
+ $this->name = "NASA APOD Bridge";
+ $this->uri = "http://apod.nasa.gov/apod/astropix.html";
+ $this->description = "Returns the 3 latest NASA APOD pictures and explanations";
+ $this->update = "2014-08-27";
+
+ }
+
public function collectData(array $param) {
$html = file_get_html('http://apod.nasa.gov/apod/archivepix.html') or $this->returnError('Error while downloading the website content', 404);
diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php
index c070038a..107f3e72 100644
--- a/bridges/NextInpactBridge.php
+++ b/bridges/NextInpactBridge.php
@@ -1,17 +1,16 @@
maintainer = "qwertygc";
+ $this->name = "NextInpact Bridge";
+ $this->uri = "http://www.nextinpact.com/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2015-10-23";
+
+ }
+
public function collectData(array $param) {
function StripCDATA($string) {
diff --git a/bridges/NiceMatinBridge.php b/bridges/NiceMatinBridge.php
index 7c0441a6..bbfe4d83 100644
--- a/bridges/NiceMatinBridge.php
+++ b/bridges/NiceMatinBridge.php
@@ -1,16 +1,16 @@
maintainer = "pit-fgfjiudghdf";
+ $this->name = "NiceMatin";
+ $this->uri = "http://www.nicematin.com/";
+ $this->description = "Returns the 10 newest posts from NiceMatin (full text)";
+ $this->update = "2014-05-26";
+
+ }
+
public function collectData(array $param){
function NiceMatinUrl($string) {
diff --git a/bridges/NumeramaBridge.php b/bridges/NumeramaBridge.php
index cc7e2f2e..f1958a40 100644
--- a/bridges/NumeramaBridge.php
+++ b/bridges/NumeramaBridge.php
@@ -1,16 +1,16 @@
maintainer = "mitsukarenai";
+ $this->name = "Numerama";
+ $this->uri = "http://www.numerama.com/";
+ $this->description = "Returns the 5 newest posts from Numerama (full text)";
+ $this->update = "2015-10-12";
+
+ }
+
public function collectData(array $param){
function NumeramaStripCDATA($string) {
diff --git a/bridges/OpenTheoryBridge.php b/bridges/OpenTheoryBridge.php
index 9117d372..ebafa330 100644
--- a/bridges/OpenTheoryBridge.php
+++ b/bridges/OpenTheoryBridge.php
@@ -1,18 +1,15 @@
maintainer = "qwertygc";
+ $this->name = "Opentheory";
+ $this->uri = "http://open1theory.com";
+ $this->description = "Returns the 5 newest posts from OpenTheory (full text)";
+ $this->update = "02-08-2014";
-
+ }
public function collectData(array $param){
diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php
index 5ada5358..6cb92e4d 100644
--- a/bridges/PlanetLibreBridge.php
+++ b/bridges/PlanetLibreBridge.php
@@ -1,15 +1,16 @@
maintainer = "pit-fgfjiudghdf";
+ $this->name = "PlanetLibre";
+ $this->uri = "http://www.planet-libre.org";
+ $this->description = "Returns the 5 newest posts from PlanetLibre (full text)";
+ $this->update = "2014-05-26";
+
+ }
+
public function collectData(array $param){
function PlanetLibreExtractContent($url) {
diff --git a/bridges/ProjectMGameBridge.php b/bridges/ProjectMGameBridge.php
index e8dc05cc..a3180416 100644
--- a/bridges/ProjectMGameBridge.php
+++ b/bridges/ProjectMGameBridge.php
@@ -1,13 +1,17 @@
maintainer = "corenting";
+ $this->name = "Project M Game Bridge";
+ $this->uri = "http://projectmgame.com/en/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2014-08-27";
+
+ }
+
+
public function collectData(array $param){
$html = '';
$html = file_get_html('http://projectmgame.com/en/') or $this->returnError('Error while downloading the Project M homepage', 404);
diff --git a/bridges/RssExpander.php b/bridges/RssExpander.php
index e8b2476d..ef35c92a 100644
--- a/bridges/RssExpander.php
+++ b/bridges/RssExpander.php
@@ -9,9 +9,9 @@
*/
abstract class RssExpander extends HttpCachingBridgeAbstract{
- protected $name;
- private $uri;
- private $description;
+ public $name;
+ public $uri;
+ public $description;
public function collectData(array $param){
if (empty($param['url'])) {
$this->returnError('There is no $param[\'url\'] for this RSS expander', 404);
@@ -65,4 +65,4 @@ abstract class RssExpander extends HttpCachingBridgeAbstract{
public function getDescription() {
return $this->description;
}
-}
\ No newline at end of file
+}
diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php
index 05c807bc..7bcc6d0a 100644
--- a/bridges/SoundcloudBridge.php
+++ b/bridges/SoundcloudBridge.php
@@ -14,7 +14,7 @@
class SoundCloudBridge extends BridgeAbstract{
private $request;
- private $name;
+ public $name;
const CLIENT_ID = '0aca19eae3843844e4053c6d8fdb7875';
public function collectData(array $param){
diff --git a/bridges/TheOatMealBridge.php b/bridges/TheOatMealBridge.php
index 84b6954b..7342ec2b 100644
--- a/bridges/TheOatMealBridge.php
+++ b/bridges/TheOatMealBridge.php
@@ -10,11 +10,11 @@
*/
require_once 'bridges/RssExpander.php';
define("THE_OATMEAL", "http://theoatmeal.com/");
-define("RSS", "http://feeds.feedburner.com/oatmealfeed");
+define("THE_OATMEAL_RSS", "http://feeds.feedburner.com/oatmealfeed");
class TheOatmealBridge extends RssExpander{
public function collectData(array $param){
- $param['url'] = RSS;
+ $param['url'] = THE_OATMEAL_RSS;
parent::collectData($param);
}
diff --git a/bridges/TwitchApiBridge.php b/bridges/TwitchApiBridge.php
index cedb7496..aec4a9c9 100644
--- a/bridges/TwitchApiBridge.php
+++ b/bridges/TwitchApiBridge.php
@@ -15,8 +15,8 @@
* Description for the API is available on GitHub: https://github.com/justintv/twitch-api
*/
-define(TWITCH_LIMIT, 10); // The default limit
-define(TWITCH_BROADCASTS, 'false'); // The default flag for broadcasts
+define('TWITCH_LIMIT', 10); // The default limit
+define('TWITCH_BROADCASTS', 'false'); // The default flag for broadcasts
class TwitchApiBridge extends BridgeAbstract{
diff --git a/bridges/WhydBridge.php b/bridges/WhydBridge.php
index 9bac7a05..060a7b62 100644
--- a/bridges/WhydBridge.php
+++ b/bridges/WhydBridge.php
@@ -14,7 +14,7 @@
class WhydBridge extends BridgeAbstract{
private $request;
- private $name;
+ public $name;
public function collectData(array $param){
$html = '';
diff --git a/bridges/WikipediaDEBridge.php b/bridges/WikipediaDEBridge.php
new file mode 100644
index 00000000..973170db
--- /dev/null
+++ b/bridges/WikipediaDEBridge.php
@@ -0,0 +1,48 @@
+returnError('Could not request Wikipedia DE.', 404);
+
+ $element = $html->find('div[id=mf-tfa]', 0);
+ $element->find('div', -1)->outertext = '';
+
+ $item = new \Item();
+ $item->uri = $host.$element->find('p', 0)->find('a', 0)->href;
+ $item->title = $element->find('p',0)->find('a',0)->title;
+
+ $html2 = file_get_html($item->uri) or $this->returnError('Could not request Wikipedia DE '.$item->title.'.', 404);
+ $element2 = $html2->find('div[id=mw-content-text]', 0);
+ $item->content = str_replace('href="/', 'href="'.$host.'/', $element2->innertext);
+
+ $this->items[] = $item;
+ }
+
+ public function getName(){
+ return 'Wikipedia DE "Today\'s Featured Article"';
+ }
+
+ public function getURI(){
+ return 'https://de.wikipedia.org/wiki/Wikipedia:Hauptseite';
+ }
+
+ public function getCacheDuration(){
+ return 3600*8; // 8 hours
+ }
+}
diff --git a/bridges/WordPressBridge.php b/bridges/WordPressBridge.php
index a2eee25b..2a182df3 100644
--- a/bridges/WordPressBridge.php
+++ b/bridges/WordPressBridge.php
@@ -14,7 +14,7 @@
class WordPressBridge extends BridgeAbstract {
private $url;
- private $name;
+ public $name;
public function collectData(array $param) {
$this->processParams($param);
diff --git a/bridges/WorldOfTanks.php b/bridges/WorldOfTanks.php
index ccc80bf5..f4de4773 100644
--- a/bridges/WorldOfTanks.php
+++ b/bridges/WorldOfTanks.php
@@ -10,8 +10,8 @@ define('WORLD_OF_TANKS', 'http://worldoftanks.eu/');
define('NEWS', '/news/');
class WorldOfTanks extends HttpCachingBridgeAbstract{
private $lang = "fr";
- private $uri = WORLD_OF_TANKS;
- private $name = 'World of tanks news';
+ public $uri = WORLD_OF_TANKS;
+ public $name = 'World of tanks news';
public function collectData(array $param){
if (!empty($param['lang'])) {
diff --git a/caches/FileCache.php b/caches/FileCache.php
index 594343d3..f2e0dbb7 100644
--- a/caches/FileCache.php
+++ b/caches/FileCache.php
@@ -24,7 +24,13 @@ class FileCache extends CacheAbstract{
public function saveData($datas){
$this->isPrepareCache();
- file_put_contents($this->getCacheFile(), json_encode($datas));
+ $writeStream = file_put_contents($this->getCacheFile(), json_encode($datas));
+
+ if(!$writeStream) {
+
+ throw new \Exception("Cannot write the cache... Do you have the right permissions ?");
+
+ }
return $this;
}
@@ -89,4 +95,4 @@ class FileCache extends CacheAbstract{
$stringToEncode = $_SERVER['REQUEST_URI'] . http_build_query($this->param);
return hash('sha1', $stringToEncode) . '.cache';
}
-}
\ No newline at end of file
+}
diff --git a/index.php b/index.php
index 5a4dea80..3c3d6780 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,4 @@
setDatas($_REQUEST);
$bridge->loadMetadatas();
// Data transformation
- $format = Format::create($format);
- $format
- ->setDatas($bridge->getDatas())
- ->setExtraInfos(array(
- 'name' => $bridge->name,
- 'uri' => $bridge->uri,
- ))
- ->display();
+ try {
+ $format = Format::create($format);
+ $format
+ ->setDatas($bridge->getDatas())
+ ->setExtraInfos(array(
+ 'name' => $bridge->getName(),
+ 'uri' => $bridge->getURI(),
+ ))
+ ->display();
+ } catch(Exception $e) {
+
+ echo "The brige has crashed. You should report this to the bridges maintainer";
+
+ }
die;
}
break;
@@ -140,7 +145,11 @@ function getHelperButtonsFormat($formats){
function displayBridgeCard($bridgeName, $formats, $isActive = true)
{
+
$bridgeElement = Bridge::create($bridgeName);
+ if($bridgeElement == false) {
+ return "";
+ }
$bridgeElement->loadMetadatas();
$name = ''.$bridgeElement->name.'';
@@ -269,10 +278,7 @@ $formats = Format::searchInformation();
?>