diff --git a/README.md b/README.md
index 90edc4d..55dfe7e 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,26 @@ Patch/contributors :
* [Polopollo](https://github.com/Polopollo)
* [16mhz](https://github.com/16mhz)
* [kranack](https://github.com/kranack)
+ * [logmanoriginal](https://github.com/logmanoriginal)
+ * [polo2ro](https://github.com/polo2ro)
+ * [Riduidel](https://github.com/Riduidel)
+ * [superbaillot.net](http://superbaillot.net/)
+ * [vinzv](https://github.com/vinzv)
+ * [teromene](https://github.com/teromene)
+ * [nel50n](https://github.com/nel50n)
+ * [nyutag](https://github.com/nyutag)
+ * [ORelio](https://github.com/ORelio)
+ * [Pitchoule](https://github.com/Pitchoule)
+ * [pit-fgfjiudghdf](https://github.com/pit-fgfjiudghdf)
+ * [aledeg](https://github.com/aledeg)
+ * [alexAubin](https://github.com/alexAubin)
+ * [cnlpete](https://github.com/cnlpete)
+ * [corenting](https://github.com/corenting)
+ * [Daiyousei](https://github.com/Daiyousei)
+ * [erwang](https://github.com/erwang)
+ * [gsurrel](https://github.com/gsurrel)
+ * [kraoc](https://github.com/kraoc)
+ * [lagaisse](https://github.com/lagaisse)
License
===
diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php
index 97955de..68e199e 100644
--- a/bridges/AnimeUltimeBridge.php
+++ b/bridges/AnimeUltimeBridge.php
@@ -1,15 +1,4 @@
;Anime=>A;Drama=>D;Tokusatsu=>T")
- */
class AnimeUltimeBridge extends BridgeAbstract {
private $filter = 'Releases';
diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php
index e12e0c3..c76e0aa 100644
--- a/bridges/CryptomeBridge.php
+++ b/bridges/CryptomeBridge.php
@@ -1,16 +1,4 @@
toURI(strtolower($param['site']));
}
// $this->message("loading feed from ".$this->getURI());
- parent::collectData($param);
+ parent::collectExpandableDatas($param, $name);
}
protected function parseRSSItem($newsItem) {
diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php
index 1563b65..19016cc 100755
--- a/bridges/LeBonCoinBridge.php
+++ b/bridges/LeBonCoinBridge.php
@@ -1,17 +1,4 @@
alsace;Aquitaine=>aquitaine;Auvergne=>auvergne;Basse Normandie=>basse_normandie;Bourgogne=>bourgogne;Bretagne=>bretagne;Centre=>centre;Champagne Ardenne=>champagne_ardenne;Corse=>corse;Franche Comté=>franche_comte;Haute Normandie=>haute_normandie;Ile de France=>ile_de_france;Languedoc Roussillon=>languedoc_roussillon;Limousin=>limousin;Lorraine=>lorraine;Midi Pyrénées=>midi_pyrenees;Nord Pas De Calais=>nord_pas_de_calais;Pays de la Loire=>pays_de_la_loire;Picardie=>picardie;Poitou Charentes=>poitou_charentes;Provence Alpes Côte d'Azur=>provence_alpes_cote_d_azur;Rhône-Alpes=>rhone_alpes;Guadeloupe=>guadeloupe;Martinique=>martinique;Guyane=>guyane;Réunion=>reunion", text|k="Keyword")
-*/
-
class LeBonCoinBridge extends BridgeAbstract{
public function loadMetadatas() {
diff --git a/bridges/Les400Culs.php b/bridges/Les400Culs.php
index 4694f40..36dc0a8 100644
--- a/bridges/Les400Culs.php
+++ b/bridges/Les400Culs.php
@@ -1,11 +1,7 @@
returnError('There is no $param[\'url\'] for this RSS expander', 404);
- }
-// $this->message("Loading from ".$param['url']);
- // Notice WE DO NOT use cache here on purpose : we want a fresh view of the RSS stream each time
- $rssContent = simplexml_load_file($param['url']) or $this->returnError('Could not request '.$param['url'], 404);
-// $this->message("loaded RSS from ".$param['url']);
- // TODO insert RSS format detection
- // we suppose for now, we have some RSS 2.0
- $this->collect_RSS_2_0_data($rssContent);
- }
-
- protected function collect_RSS_2_0_data($rssContent) {
- $rssContent = $rssContent->channel[0];
-// $this->message("RSS content is ===========\n".var_export($rssContent, true)."===========");
- $this->load_RSS_2_0_feed_data($rssContent);
- foreach($rssContent->item as $item) {
-// $this->message("parsing item ".var_export($item, true));
- $this->items[] = $this->parseRSSItem($item);
- }
- }
-
- protected function RSS_2_0_time_to_timestamp($item) {
- return DateTime::createFromFormat('D, d M Y H:i:s e', $item->pubDate)->getTimestamp();
- }
-
- // TODO set title, link, description, language, and so on
- protected function load_RSS_2_0_feed_data($rssContent) {
- $this->name = trim($rssContent->title);
- $this->uri = trim($rssContent->link);
- $this->description = trim($rssContent->description);
- }
-
- /**
- * Method should return, from a source RSS item given by lastRSS, one of our Items objects
- * @param $item the input rss item
- * @return a RSS-Bridge Item, with (hopefully) the whole content)
- */
- abstract protected function parseRSSItem($item);
-
-
- public function getName(){
- return $this->name;
- }
-
- public function getURI(){
- return $this->uri;
- }
-
- public function getDescription() {
- return $this->description;
- }
-}
diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php
index 2b19b23..dc32a25 100644
--- a/bridges/SoundcloudBridge.php
+++ b/bridges/SoundcloudBridge.php
@@ -1,16 +1,4 @@
true;Don't show broadcasts=>false")
-* @use2(text|channel="Channel", text|limit="Limit", list|broadcasts="Show broadcasts=>true;Don't show broadcasts=>false")
-*
-* 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
class TwitchApiBridge extends BridgeAbstract{
-
+
// for use in the getName function!
private $channel;
diff --git a/index.php b/index.php
index 01aa538..6b8261b 100644
--- a/index.php
+++ b/index.php
@@ -52,16 +52,10 @@ if (!file_exists($whitelist_file)) {
}
else {
$whitelist_selection = explode("\n", file_get_contents($whitelist_file));
+ //Remove the last empty line.
array_pop($whitelist_selection);
}
-// whitelist control function
-function BridgeWhitelist( $whitelist, $name ) {
- if(in_array("$name", $whitelist) or in_array("$name.php", $whitelist))
- return TRUE;
- else
- return FALSE;
-}
try{
require_once __DIR__ . '/lib/RssBridge.php';
@@ -81,7 +75,7 @@ try{
unset($_REQUEST['format']);
// whitelist control
- if(!BridgeWhitelist($whitelist_selection, $bridge)) {
+ if(!Bridge::isWhitelisted($whitelist_selection, $bridge)) {
throw new \HttpException('This bridge is not whitelisted', 401);
die;
}
@@ -126,119 +120,6 @@ catch(\Exception $e){
die($e->getMessage());
}
-function getHelperButtonFormat($value, $name){
- return '';
-}
-
-function getHelperButtonsFormat($formats){
- $buttons = '';
- foreach( $formats as $name => $infos )
- {
- if ( isset($infos['name']) )
- {
- $buttons .= getHelperButtonFormat($name, $infos['name']) . PHP_EOL;
- }
- }
- return $buttons;
-}
-
-function displayBridgeCard($bridgeName, $formats, $isActive = true)
-{
-
-
- $bridgeElement = Bridge::create($bridgeName);
- if($bridgeElement == false) {
- return "";
- }
- $bridgeElement->loadMetadatas();
-
- $name = ''.$bridgeElement->name.'';
- $description = $bridgeElement->description;
-
- $card = <<
-
{$name}
-
- {$description}
-
-CARD;
-
- // If we don't have any parameter for the bridge, we print a generic form to load it.
- if(count($bridgeElement->parameters) == 0) {
-
- $card .= '' . PHP_EOL;
-
- }
-
- foreach($bridgeElement->parameters as $parameterName => $parameter)
- {
- $card .= '' . PHP_EOL;
- if(!is_numeric($parameterName)) {
- $card .= '