diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php
index 0aa787b..bcc6d2f 100644
--- a/bridges/YoutubeBridge.php
+++ b/bridges/YoutubeBridge.php
@@ -2,25 +2,70 @@
/**
* RssBridgeYoutube
* Returns the newest videos
-*
-* @name Youtube Bridge
-* @homepage https://www.youtube.com/
-* @description Returns the 10 newest videos by username/channel/playlist or search
-* @maintainer mitsukarenai
-* @update 2015-07-08
-* @use1(u="username")
-* @use2(c="channel id")
-* @use3(p="playlist id")
-* @use4(s="search keyword",pa="page")
-*
-* WARNING: to parse big playlists (over ~90 videos), you need to edit simple_html_dom.php:
+* WARNING: to parse big playlists (over ~90 videos), you need to edit simple_html_dom.php:
* change: define('MAX_FILE_SIZE', 600000);
* into: define('MAX_FILE_SIZE', 900000); (or more)
*/
-class YoutubeBridge extends BridgeAbstract{
-
- private $request;
-
+class YoutubeBridge extends BridgeAbstract {
+
+
+ public function loadMetadatas() {
+
+ $this->name = "Youtube Bridge";
+
+ $this->homepage = "https://youtube.com";
+ $this->description = "Returns the 10 newest videos by username/channel/playlist or search";
+ $this->maintainer = "mitsukarenai";
+
+ $this->parameters["By username"] =
+ '[
+ {
+ "type" : "text",
+ "identifier" : "u",
+ "name" : "username",
+ "exampleValue" : "test"
+ }
+ ]';
+
+ $this->parameters['By channel id'] =
+ '[
+ {
+ "type" : "number",
+ "identifier" : "c",
+ "name" : "channel id",
+ "exampleValue" : "15"
+ }
+ ]';
+
+ $this->parameters['By playlist Id'] =
+ '[
+ {
+ "type" : "number",
+ "identifier" : "c",
+ "name" : "playlist id",
+ "exampleValue" : "15"
+ }
+ ]';
+
+ $this->parameters["Search result"] =
+ '[
+ {
+ "type" : "text",
+ "identifier" : "s",
+ "name" : "search keyword",
+ "exampleValue" : "test"
+
+ },
+ {
+ "type" : "number",
+ "identifier" : "pa",
+ "name" : "page",
+ "exampleValue" : "1"
+
+ }
+ ]';
+ }
+
public function collectData(array $param){
function getPublishDate($id) {
diff --git a/index.php b/index.php
index 75eadda..72ee585 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,5 @@
'.$bridgeInformations['name'].'' : $bridgeInformations['name'];
- $description = isset($bridgeInformations['description']) ? $bridgeInformations['description'] : 'No description provided';
+
+ $bridgeElement = Bridge::create($bridgeName);
+ $bridgeElement->loadMetadatas();
+
+ $name = ''.$bridgeElement->name.'';
+ $description = $bridgeElement->description;
+
$card = <<
+ ';
return $card;
}
-$bridges = Bridge::searchInformation();
$formats = Format::searchInformation();
+
?>
@@ -257,24 +258,27 @@ $formats = Format::searchInformation();
$activeFoundBridgeCount = 0;
$showInactive = isset($_REQUEST['show_inactive']) && $_REQUEST['show_inactive'] == 1;
$inactiveBridges = '';
- foreach($bridges as $bridgeReference => $bridgeInformations)
+ foreach($whitelist_selection as $bridgeName)
{
- if(BridgeWhitelist($whitelist_selection, $bridgeReference))
+ if(BridgeWhitelist($whitelist_selection, $bridgeName))
{
- echo displayBridgeCard($bridgeReference, $bridgeInformations, $formats);
+ echo displayBridgeCard($bridgeName, $formats);
$activeFoundBridgeCount++;
}
elseif ($showInactive)
{
// inactive bridges
- $inactiveBridges .= displayBridgeCard($bridgeReference, $bridgeInformations, $formats, false) . PHP_EOL;
+ $inactiveBridges .= displayBridgeCard($bridgeName, $formats, false) . PHP_EOL;
}
}
echo '
' . $inactiveBridges;
?>
+