diff --git a/CREATE_BRIDGE.md b/CREATE_BRIDGE.md
new file mode 100644
index 0000000..215ae28
--- /dev/null
+++ b/CREATE_BRIDGE.md
@@ -0,0 +1,23 @@
+# Howto create a bridge
+
+A bridge is an interface that allows rss-bridge to create a RSS feed from a website.
+The bridge is a PHP file, located in the `bridges/` folder.
+
+##Specifications
+
+A rss bridge must extend the `BridgeAbstract` class, and implement the following functions :
+
+* The `loadMetadatas` function, described below,
+* The `getCacheDuration` function, describing the time during which rss-bridge will output cached values instead of re-generating a RSS feed.
+* The `collectData` function, also described below.
+
+##The `collectData` function
+
+This function takes as a parameter an array called `$param`, that is automatically filled with values from the user, according to the values setted in `loadMetadatas`.
+This function is the place where all the website scrapping and the RSS feed generation process will go.
+
+The RSS elements are stored in the class variable `items[]`.
+
+Every RSS element is an instance of the `Item` class.
+
+
diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php
index 97a2e4a..d50a0d6 100644
--- a/bridges/AcrimedBridge.php
+++ b/bridges/AcrimedBridge.php
@@ -1,6 +1,6 @@
maintainer = "qwertygc";
+ $this->name = "Acrimed Bridge";
+ $this->uri = "http://www.acrimed.org/";
+ $this->description = "Returns the newest articles.";
+ $this->update = "2014-05-25";
+
+ }
+ public function collectData(array $param){
function StripCDATA($string) {
$string = str_replace('maintainer = "mitsukarenai";
+ $this->name = "Arte +7";
+ $this->uri = "http://www.arte.tv/";
+ $this->description = "Returns newest videos from ARTE +7";
+ $this->update = "2015-10-31";
+ $this->parameters["Catégorie (Français)"] =
+ '[
+ {
+ "type" : "list",
+ "identifier" : "catfr",
+ "name" : "Catégorie",
+ "values" : [
+ {
+ "name" : "Toutes les vidéos (français)",
+ "value" : "toutes-les-videos"
+ },
+ {
+ "name" : "Actu & société",
+ "value" : "actu-société"
+ },
+ {
+ "name" : "Séries & fiction",
+ "value" : "séries-fiction"
+ },
+ {
+ "name" : "Cinéma",
+ "value" : "cinéma"
+ }
+
+ ]
+
+
+ }
+
+ ]';
+ }
+
+
public function collectData(array $param){
function extractVideoset($category='toutes-les-videos', $lang='fr')
diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php
new file mode 100644
index 0000000..df38be6
--- /dev/null
+++ b/bridges/DemoBridge.php
@@ -0,0 +1,72 @@
+maintainer = "teromene";
+ $this->name = "DemoBridge";
+ $this->uri = "http://github.com/sebsauvage/rss-bridge";
+ $this->description = "Bridge used for demos";
+ $this->update = "2015-11-03";
+
+ $this->parameters['testCheckbox'] =
+ '[
+ {
+ "type" : "checkbox",
+ "identifier" : "testCheckbox",
+ "name" : "test des checkbox"
+ }
+
+ ]';
+
+ $this->parameters['testList'] =
+ '[
+ {
+ "type" : "list",
+ "identifier" : "testList",
+ "name" : "test des listes",
+ "values" : [
+ {
+ "name" : "Test",
+ "value" : "test"
+ },
+ {
+ "name" : "Test 2",
+ "value" : "test2"
+ }
+ ]
+ }
+ ]';
+ $this->parameters['testNumber'] =
+ '[
+ {
+ "type" : "number",
+ "identifier" : "testNumber",
+ "name" : "test des numéros",
+ "exampleValue" : "1515632"
+
+ }
+
+ ]';
+
+ }
+
+ public function collectData(array $param){
+
+ }
+
+ public function getCacheDuration(){
+ return 3600; // 1 hour
+ }
+}
diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php
index 15f648c..dc37d5e 100644
--- a/bridges/FacebookBridge.php
+++ b/bridges/FacebookBridge.php
@@ -9,7 +9,7 @@
*/
class FacebookBridge extends BridgeAbstract{
- private $name;
+
public function collectData(array $param){
diff --git a/index.php b/index.php
index 494ebb3..5a4dea8 100644
--- a/index.php
+++ b/index.php
@@ -96,14 +96,14 @@ try{
$bridge->setCache($cache); // just add disable cache to your query to disable caching
}
$bridge->setDatas($_REQUEST);
-
+ $bridge->loadMetadatas();
// Data transformation
$format = Format::create($format);
$format
->setDatas($bridge->getDatas())
->setExtraInfos(array(
- 'name' => $bridge->getName(),
- 'uri' => $bridge->getURI(),
+ 'name' => $bridge->name,
+ 'uri' => $bridge->uri,
))
->display();
die;
@@ -143,7 +143,7 @@ function displayBridgeCard($bridgeName, $formats, $isActive = true)
$bridgeElement = Bridge::create($bridgeName);
$bridgeElement->loadMetadatas();
- $name = ''.$bridgeElement->name.'';
+ $name = ''.$bridgeElement->name.'';
$description = $bridgeElement->description;
$card = <<parameters) == 0) {
- $card .= '