From fbf17beae897644d6900fc984d3e1a521db5a498 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?=
Tags: '.$item['tags'];
$this->items[] = $item;
}
diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php
index d3d191ef..4c695f06 100644
--- a/bridges/CADBridge.php
+++ b/bridges/CADBridge.php
@@ -34,7 +34,7 @@ class CADBridge extends BridgeAbstract{
return '';
}
- public function collectData(array $param){
+ public function collectData(){
function CADUrl($string) {
$html2 = explode("\"", $string);
$string = $html2[1];
diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php
index 623a9fd6..2fbed359 100644
--- a/bridges/CNETBridge.php
+++ b/bridges/CNETBridge.php
@@ -15,7 +15,8 @@ class CNETBridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@@ -42,8 +43,8 @@ class CNETBridge extends BridgeAbstract {
return $article_html;
}
- if (!empty($param['topic']))
- $this->topicName = $param['topic'];
+ if (!empty($param['topic']['value']))
+ $this->topicName = $param['topic']['value'];
$pageUrl = 'http://www.cnet.com/'.(empty($this->topicName) ? '' : 'topics/'.$this->topicName.'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php
index a682ae0a..73e8a1af 100644
--- a/bridges/CastorusBridge.php
+++ b/bridges/CastorusBridge.php
@@ -73,12 +73,13 @@ class CastorusBridge extends BridgeAbstract {
return $price->innertext;
}
- public function collectData(array $params){
- if(isset($params['zip']))
- $zip_filter = trim($params['zip']);
+ public function collectData(){
+ $params=$this->parameters[$this->queriedContext];
+ if(isset($params['zip']['value']))
+ $zip_filter = trim($params['zip']['value']);
- if(isset($params['city']))
- $city_filter = trim($params['city']);
+ if(isset($params['city']['value']))
+ $city_filter = trim($params['city']['value']);
$html = $this->getSimpleHTMLDOM($this->uri);
diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php
index d9b7266c..241e6f38 100644
--- a/bridges/CollegeDeFranceBridge.php
+++ b/bridges/CollegeDeFranceBridge.php
@@ -8,7 +8,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{
$this->description = "Returns the latest audio and video from CollegeDeFrance";
}
- public function collectData(array $param) {
+ public function collectData(){
$months = array(
'01' => 'janv.',
'02' => 'févr.',
diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php
index d10748cc..21dfcbe1 100644
--- a/bridges/CommonDreamsBridge.php
+++ b/bridges/CommonDreamsBridge.php
@@ -16,7 +16,7 @@ class CommonDreamsBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
function CommonDreamsUrl($string) {
$html2 = explode(" ", $string);
diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php
index 80fcd452..a4420e6f 100644
--- a/bridges/CopieDoubleBridge.php
+++ b/bridges/CopieDoubleBridge.php
@@ -11,7 +11,7 @@ class CopieDoubleBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.copie-double.com/') or $this->returnServerError('Could not request CopieDouble.');
$table = $html->find('table table', 2);
diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php
index e921d815..62c8feec 100644
--- a/bridges/CourrierInternationalBridge.php
+++ b/bridges/CourrierInternationalBridge.php
@@ -10,7 +10,7 @@ class CourrierInternationalBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = '';
diff --git a/bridges/CpasbienBridge.php b/bridges/CpasbienBridge.php
index 4772e599..c0583cfc 100644
--- a/bridges/CpasbienBridge.php
+++ b/bridges/CpasbienBridge.php
@@ -21,11 +21,12 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$this->loadMetadatas();
$html = '';
- if (isset($param['q'])) { /* keyword search mode */
- $this->request = str_replace(" ","-",trim($param['q']));
+ if (isset($param['q']['value'])) { /* keyword search mode */
+ $this->request = str_replace(" ","-",trim($param['q']['value']));
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($this->request).'.html') or $this->returnServerError('No results for this query.');
}
else {
diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php
index 4f40d617..daf404fb 100644
--- a/bridges/CryptomeBridge.php
+++ b/bridges/CryptomeBridge.php
@@ -18,7 +18,8 @@ class CryptomeBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$num = 20;
$link = 'http://cryptome.org/';
@@ -26,8 +27,8 @@ class CryptomeBridge extends BridgeAbstract{
//$link = 'https://secure.netsolhost.com/cryptome.org/';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request Cryptome.');
- if (!empty($param['n'])) { /* number of documents */
- $num = min(max(1, $param['n']+0), $num);
+ if (!empty($param['n']['value'])) { /* number of documents */
+ $num = min(max(1, $param['n']['value']+0), $num);
}
diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php
index 89b4cb33..0a73df8f 100644
--- a/bridges/DailymotionBridge.php
+++ b/bridges/DailymotionBridge.php
@@ -45,21 +45,22 @@ class DailymotionBridge extends BridgeAbstract{
return $metadata;
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$limit = 5;
$count = 0;
- if (isset($param['u'])) { // user timeline mode
- $this->request = $param['u'];
+ if (isset($param['u']['value'])) { // user timeline mode
+ $this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/user/'.urlencode($this->request).'/1') or $this->returnServerError('Could not request Dailymotion.');
}
- else if (isset($param['p'])) { // playlist mode
- $this->request = strtok($param['p'], '_');
+ else if (isset($param['p']['value'])) { // playlist mode
+ $this->request = strtok($param['p']['value'], '_');
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/playlist/'.urlencode($this->request).'') or $this->returnServerError('Could not request Dailymotion.');
}
- else if (isset($param['s'])) { // search mode
- $this->request = $param['s']; $page = 1; if (isset($param['pa'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']);
+ else if (isset($param['s']['value'])) { // search mode
+ $this->request = $param['s']['value']; $page = 1; if (isset($param['pa']['value'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']['value']);
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/search/'.urlencode($this->request).'/'.$page.'') or $this->returnServerError('Could not request Dailymotion.');
}
else {
diff --git a/bridges/DanbooruBridge.php b/bridges/DanbooruBridge.php
index 7b451de6..f41bc776 100644
--- a/bridges/DanbooruBridge.php
+++ b/bridges/DanbooruBridge.php
@@ -14,13 +14,14 @@ class DanbooruBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://donmai.us/posts?&page=$page&tags=$tags") or $this->returnServerError('Could not request Danbooru.');
foreach($html->find('div[id=posts] article') as $element) {
diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php
index 1492c19d..83f6cd2a 100644
--- a/bridges/DansTonChatBridge.php
+++ b/bridges/DansTonChatBridge.php
@@ -10,7 +10,7 @@ class DansTonChatBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = '';
$link = 'http://danstonchat.com/latest.html';
diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php
index f7652745..d97a0a59 100644
--- a/bridges/DauphineLibereBridge.php
+++ b/bridges/DauphineLibereBridge.php
@@ -40,7 +40,8 @@ class DauphineLibereBridge extends BridgeAbstract {
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
// Simulate Mozilla user-agent to fix error 403 (Forbidden)
$opts = array('http' =>
@@ -52,8 +53,8 @@ class DauphineLibereBridge extends BridgeAbstract {
$context = stream_context_create($opts);
- if (isset($param['u'])) { /* user timeline mode */
- $this->request = $param['u'];
+ if (isset($param['u']['value'])) { /* user timeline mode */
+ $this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://www.ledauphine.com/'.$this->request.'/rss',false,$context) or $this->returnServerError('Could not request DauphineLibere.');
}
else {
diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php
index 6ffb80a7..f6d6efb1 100644
--- a/bridges/DemoBridge.php
+++ b/bridges/DemoBridge.php
@@ -35,7 +35,7 @@ class DemoBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
$item = array();
$item['author'] = "Me!";
diff --git a/bridges/DeveloppezDotComBridge.php b/bridges/DeveloppezDotComBridge.php
index a4c2a52d..ca18fe39 100644
--- a/bridges/DeveloppezDotComBridge.php
+++ b/bridges/DeveloppezDotComBridge.php
@@ -40,7 +40,7 @@ class DeveloppezDotComBridge extends BridgeAbstract{
return trim($text);
}
- public function collectData(array $param){
+ public function collectData(){
$rssFeed = $this->getSimpleHTMLDOM('http://www.developpez.com/index/rss') or $this->returnServerError('Could not request http://www.developpez.com/index/rss');
$limit = 0;
diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php
index 426343c4..e0c23e6f 100644
--- a/bridges/DilbertBridge.php
+++ b/bridges/DilbertBridge.php
@@ -10,7 +10,7 @@ class DilbertBridge extends BridgeAbstract {
}
- public function collectData(array $param) {
+ public function collectData(){
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request Dilbert: '.$this->getURI());
diff --git a/bridges/DollbooruBridge.php b/bridges/DollbooruBridge.php
index 865fbfff..fb3a5da6 100644
--- a/bridges/DollbooruBridge.php
+++ b/bridges/DollbooruBridge.php
@@ -18,13 +18,14 @@ class DollbooruBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://dollbooru.org/post/list/$tags/$page") or $this->returnServerError('Could not request Dollbooru.');
diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php
index 30282020..1522978e 100644
--- a/bridges/DuckDuckGoBridge.php
+++ b/bridges/DuckDuckGoBridge.php
@@ -15,9 +15,10 @@ class DuckDuckGoBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- $link = 'http://duckduckgo.com/html/?q='.$param['u'].'+sort:date';
+ $link = 'http://duckduckgo.com/html/?q='.$param['u']['value'].'+sort:date';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DuckDuckGo.');
diff --git a/bridges/EZTVBridge.php b/bridges/EZTVBridge.php
index 847e70a1..83b93d13 100644
--- a/bridges/EZTVBridge.php
+++ b/bridges/EZTVBridge.php
@@ -17,7 +17,8 @@ class EZTVBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
// Make timestamp from relative released time in table
function makeTimestamp($relativeReleaseTime){
@@ -33,11 +34,11 @@ class EZTVBridge extends BridgeAbstract{
}
// Check for ID provided
- if (!isset($param['i']))
+ if (!isset($param['i']['value']))
$this->returnClientError('You must provide a list of ID (?i=showID1,showID2,...)');
// Loop on show ids
- $showList = explode(",",$param['i']);
+ $showList = explode(",",$param['i']['value']);
foreach($showList as $showID){
// Get show page
diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php
index 13dcf50d..9e9400d0 100644
--- a/bridges/EliteDangerousGalnetBridge.php
+++ b/bridges/EliteDangerousGalnetBridge.php
@@ -10,7 +10,7 @@ class EliteDangerousGalnetBridge extends BridgeAbstract
$this->description = "Returns the latest page of news from Galnet";
}
- public function collectData(array $param)
+ public function collectData()
{
$html = $this->getSimpleHTMLDOM('https://community.elitedangerous.com/galnet') or $this->returnServerError('Error while downloading the website content');
foreach($html->find('div.article') as $element) {
diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php
index b336f4c8..25a9446f 100644
--- a/bridges/ElsevierBridge.php
+++ b/bridges/ElsevierBridge.php
@@ -58,9 +58,10 @@ class ElsevierBridge extends BridgeAbstract{
return '';
}
- public function collectData(array $param){
- $uri = 'http://www.journals.elsevier.com/' . $param['j'] . '/recent-articles/';
- $html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$param['j']);
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ $uri = 'http://www.journals.elsevier.com/' . $param['j']['value'] . '/recent-articles/';
+ $html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$param['j']['value']);
foreach($html->find('.pod-listing') as $article){
$item = array();
diff --git a/bridges/EstCeQuonMetEnProdBridge.php b/bridges/EstCeQuonMetEnProdBridge.php
index be1fe1ad..383d7712 100644
--- a/bridges/EstCeQuonMetEnProdBridge.php
+++ b/bridges/EstCeQuonMetEnProdBridge.php
@@ -8,7 +8,7 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
$this->description = 'Should we put a website in production today? (French)';
}
- public function collectData(array $param) {
+ public function collectData(){
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
$section_retrieved = substr($string, strpos($string, $start) + strlen($start));
diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php
index efa49f0f..4c67c50e 100644
--- a/bridges/FacebookBridge.php
+++ b/bridges/FacebookBridge.php
@@ -16,7 +16,8 @@ class FacebookBridge extends BridgeAbstract{
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
//Extract a string using start and end delimiters
function ExtractFromDelimiters($string, $start, $end) {
@@ -104,11 +105,11 @@ class FacebookBridge extends BridgeAbstract{
//Retrieve page contents
if (is_null($html)) {
- if (isset($param['u'])) {
- if (!strpos($param['u'], "/")) {
- $html = $this->getSimpleHTMLDOM('https://www.facebook.com/'.urlencode($param['u']).'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
+ if (isset($param['u']['value'])) {
+ if (!strpos($param['u']['value'], "/")) {
+ $html = $this->getSimpleHTMLDOM('https://www.facebook.com/'.urlencode($param['u']['value']).'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
} else {
- $html = $this->getSimpleHTMLDOM('https://www.facebook.com/pages/'.$param['u'].'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
+ $html = $this->getSimpleHTMLDOM('https://www.facebook.com/pages/'.$param['u']['value'].'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
}
} else {
$this->returnClientError('You must specify a Facebook username.');
@@ -148,7 +149,7 @@ class FacebookBridge extends BridgeAbstract{
if(isset($element)) {
$author = str_replace(' | Facebook', '', $html->find('title#pageTitle', 0)->innertext);
- $profilePic = 'https://graph.facebook.com/'.$param['u'].'/picture?width=200&height=200';
+ $profilePic = 'https://graph.facebook.com/'.$param['u']['value'].'/picture?width=200&height=200';
$this->name = $author;
foreach($element->children() as $post) {
@@ -207,8 +208,8 @@ class FacebookBridge extends BridgeAbstract{
}
public function setDatas(array $param){
- if (isset($param['captcha_response']))
- unset($param['captcha_response']);
+ if (isset($param['captcha_response']['value']))
+ unset($param['captcha_response']['value']);
parent::setDatas($param);
}
diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php
index 5a432fc0..44a792ab 100644
--- a/bridges/FierPandaBridge.php
+++ b/bridges/FierPandaBridge.php
@@ -10,7 +10,7 @@ Class FierPandaBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$link = 'http://www.fier-panda.fr/';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request Fier Panda.');
diff --git a/bridges/FlickrExploreBridge.php b/bridges/FlickrExploreBridge.php
index 25760fd9..09f946e7 100644
--- a/bridges/FlickrExploreBridge.php
+++ b/bridges/FlickrExploreBridge.php
@@ -10,7 +10,7 @@ class FlickrExploreBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('https://www.flickr.com/explore') or $this->returnServerError('Could not request Flickr.');
foreach($html->find('.photo-list-photo-view') as $element) {
diff --git a/bridges/FlickrTagBridge.php b/bridges/FlickrTagBridge.php
index 424f989b..2c6158d7 100644
--- a/bridges/FlickrTagBridge.php
+++ b/bridges/FlickrTagBridge.php
@@ -17,14 +17,15 @@ class FlickrTagBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q=vendee&s=rec') or $this->returnServerError('Could not request Flickr.');
- if (isset($param['q'])) { /* keyword search mode */
- $this->request = $param['q'];
+ if (isset($param['q']['value'])) { /* keyword search mode */
+ $this->request = $param['q']['value'];
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q='.urlencode($this->request).'&s=rec') or $this->returnServerError('No results for this query.');
}
- elseif (isset($param['u'])) { /* user timeline mode */
- $this->request = $param['u'];
+ elseif (isset($param['u']['value'])) { /* user timeline mode */
+ $this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/photos/'.urlencode($this->request).'/') or $this->returnServerError('Requested username can\'t be found.');
}
diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php
index 525aa9e4..326cbd50 100644
--- a/bridges/FootitoBridge.php
+++ b/bridges/FootitoBridge.php
@@ -10,7 +10,7 @@ class FootitoBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.footito.fr/') or $this->returnServerError('Could not request Footito.');
foreach($html->find('div.post') as $element) {
diff --git a/bridges/FourchanBridge.php b/bridges/FourchanBridge.php
index 4b3a9b0f..976d8dba 100644
--- a/bridges/FourchanBridge.php
+++ b/bridges/FourchanBridge.php
@@ -14,12 +14,13 @@ class FourchanBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
- if (!isset($param['t']))
+ if (!isset($param['t']['value']))
$this->returnClientError('You must specify the thread URL (?t=...)');
- $thread = parse_url($param['t']) or $this->returnClientError('This URL seems malformed, please check it.');
+ $thread = parse_url($param['t']['value']) or $this->returnClientError('This URL seems malformed, please check it.');
if($thread['host'] !== 'boards.4chan.org')
$this->returnClientError('4chan thread URL only.');
diff --git a/bridges/FreenewsBridge.php b/bridges/FreenewsBridge.php
index 871d10bd..f84dc7ac 100644
--- a/bridges/FreenewsBridge.php
+++ b/bridges/FreenewsBridge.php
@@ -14,7 +14,8 @@ class FreenewsBridge extends RssExpander {
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
parent::collectExpandableDatas($param, FREENEWS_RSS);
}
diff --git a/bridges/FuturaSciencesBridge.php b/bridges/FuturaSciencesBridge.php
index 2d0869cd..06033935 100644
--- a/bridges/FuturaSciencesBridge.php
+++ b/bridges/FuturaSciencesBridge.php
@@ -81,7 +81,8 @@ class FuturaSciencesBridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
function StripCDATA($string) {
$string = str_replace('getURI().'rss/'.$param['feed'].'.xml';
- if (empty($param['feed']))
+ $url = $this->getURI().'rss/'.$param['feed']['value'].'.xml';
+ if (empty($param['feed']['value']))
$this->returnClientError('Please select a feed to display.'.$url);
- if ($param['feed'] !== preg_replace('/[^a-zA-Z-\/]+/', '', $param['feed']) || substr_count($param['feed'], '/') > 1 || strlen($param['feed'] > 64))
+ if ($param['feed']['value'] !== preg_replace('/[^a-zA-Z-\/]+/', '', $param['feed']['value']) || substr_count($param['feed']['value'], '/') > 1 || strlen($param['feed']['value'] > 64))
$this->returnClientError('Invalid "feed" parameter.'.$url);
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request Futura-Sciences: '.$url);
diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php
index 4c1bf210..f8fc9ff0 100644
--- a/bridges/GBAtempBridge.php
+++ b/bridges/GBAtempBridge.php
@@ -63,11 +63,12 @@ class GBAtempBridge extends BridgeAbstract {
return $this->cleanup_post_content($content, $site_url);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$typeFilter = '';
- if (!empty($param['type'])) {
- if ($param['type'] == 'N' || $param['type'] == 'R' || $param['type'] == 'T' || $param['type'] == 'F') {
- $typeFilter = $param['type'];
+ if (!empty($param['type']['value'])) {
+ if ($param['type']['value'] == 'N' || $param['type']['value'] == 'R' || $param['type']['value'] == 'T' || $param['type']['value'] == 'F') {
+ $typeFilter = $param['type']['value'];
if ($typeFilter == 'N') { $this->filter = 'News'; }
if ($typeFilter == 'R') { $this->filter = 'Review'; }
if ($typeFilter == 'T') { $this->filter = 'Tutorial'; }
diff --git a/bridges/GawkerBridge.php b/bridges/GawkerBridge.php
index ea89af32..cc1ae631 100644
--- a/bridges/GawkerBridge.php
+++ b/bridges/GawkerBridge.php
@@ -21,12 +21,13 @@ class GawkerBridge extends RssExpander{
return RSS_PREFIX.$name.RSS_SUFFIX;
}
- public function collectData(array $param){
- if (empty($param['site'])) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ if (empty($param['site']['value'])) {
trigger_error("If no site is provided, nothing is gonna happen", E_USER_ERROR);
} else {
- $this->name = $param['site'];
- $url = $this->toURI(strtolower($param['site']));
+ $this->name = $param['site']['value'];
+ $url = $this->toURI(strtolower($param['site']['value']));
}
$this->debugMessage("loading feed from ".$this->getURI());
parent::collectExpandableDatas($param, $url);
diff --git a/bridges/GelbooruBridge.php b/bridges/GelbooruBridge.php
index d463975a..94d35949 100644
--- a/bridges/GelbooruBridge.php
+++ b/bridges/GelbooruBridge.php
@@ -18,15 +18,16 @@ class GelbooruBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 63;
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://gelbooru.com/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Gelbooru.');
diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php
index 0ad0f910..b294969b 100644
--- a/bridges/GiphyBridge.php
+++ b/bridges/GiphyBridge.php
@@ -20,23 +20,24 @@ class GiphyBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$base_url = 'http://giphy.com';
- if (isset($param['s'])) { /* keyword search mode */
- $html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($param['s'].'/')) or $this->returnServerError('No results for this query.');
+ if (isset($param['s']['value'])) { /* keyword search mode */
+ $html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($param['s']['value'].'/')) or $this->returnServerError('No results for this query.');
}
else {
$this->returnClientError('You must specify a search worf (?s=...).');
}
$max = GIPHY_LIMIT;
- if (isset($param['n'])) {
- $max = (integer) $param['n'];
+ if (isset($param['n']['value'])) {
+ $max = (integer) $param['n']['value'];
}
$limit = 0;
- $kw = urlencode($param['s']);
+ $kw = urlencode($param['s']['value']);
foreach($html->find('div.hoverable-gif') as $entry) {
if($limit < $max) {
$node = $entry->first_child();
diff --git a/bridges/GithubIssueBridge.php b/bridges/GithubIssueBridge.php
index 9bfddb84..3374ed8b 100644
--- a/bridges/GithubIssueBridge.php
+++ b/bridges/GithubIssueBridge.php
@@ -28,12 +28,13 @@ class GithubIssueBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
- $uri = 'https://github.com/'.$param['u'].'/'.$param['p'].'/issues/'.(isset($param['i'])?$param['i']:'');
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ $uri = 'https://github.com/'.$param['u']['value'].'/'.$param['p']['value'].'/issues/'.(isset($param['i']['value'])?$param['i']['value']:'');
$html = $this->getSimpleHTMLDOM($uri)
- or $this->returnServerError('No results for Github Issue '.$param['i'].' in project '.$param['u'].'/'.$param['p']);
+ or $this->returnServerError('No results for Github Issue '.$param['i']['value'].' in project '.$param['u']['value'].'/'.$param['p']['value']);
- if(isset($param['i'])){
+ if(isset($param['i']['value'])){
foreach($html->find('.js-comment-container') as $comment){
$item = array();
diff --git a/bridges/GitlabCommitsBridge.php b/bridges/GitlabCommitsBridge.php
index 762e642a..61c15b57 100644
--- a/bridges/GitlabCommitsBridge.php
+++ b/bridges/GitlabCommitsBridge.php
@@ -33,29 +33,30 @@ class GitlabCommitsBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
- $uri = $param['uri'].'/'.$param['u'].'/'.$param['p'].'/commits/';
- if(isset($param['b'])){
- $uri.=$param['b'];
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ $uri = $param['uri']['value'].'/'.$param['u']['value'].'/'.$param['p']['value'].'/commits/';
+ if(isset($param['b']['value'])){
+ $uri.=$param['b']['value'];
}else{
$uri.='master';
}
$html = $this->getSimpleHTMLDOM($uri)
- or $this->returnServerError('No results for Gitlab Commits of project '.$param['uri'].'/'.$param['u'].'/'.$param['p']);
+ or $this->returnServerError('No results for Gitlab Commits of project '.$param['uri']['value'].'/'.$param['u']['value'].'/'.$param['p']['value']);
foreach($html->find('li.commit') as $commit){
$item = array();
- $item['uri']=$param['uri'];
+ $item['uri']=$param['uri']['value'];
foreach($commit->getElementsByTagName('a') as $a){
$classes=explode(' ',$a->getAttribute("class"));
if(in_array('commit-short-id',$classes) ||
in_array('commit_short_id',$classes)){
$href=$a->getAttribute('href');
- $item['uri'].=substr($href,strpos($href,'/'.$param['u'].'/'.$param['p']));
+ $item['uri'].=substr($href,strpos($href,'/'.$param['u']['value'].'/'.$param['p']['value']));
}
if(in_array('commit-row-message',$classes)){
$item['title']=$a->plaintext;
diff --git a/bridges/GizmodoFRBridge.php b/bridges/GizmodoFRBridge.php
index 8bd32176..ce4e96d2 100644
--- a/bridges/GizmodoFRBridge.php
+++ b/bridges/GizmodoFRBridge.php
@@ -10,7 +10,7 @@ class GizmodoFRBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
function GizmodoFRExtractContent($url) {
$articleHTMLContent = $this->getSimpleHTMLDOM($url);
diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php
index 46d74ac0..56af4524 100644
--- a/bridges/GooglePlusPostBridge.php
+++ b/bridges/GooglePlusPostBridge.php
@@ -22,14 +22,14 @@ class GooglePlusPostBridge extends BridgeAbstract
const GOOGLE_PLUS_BASE_URL = 'https://plus.google.com/';
- public function collectData(array $param)
+ public function collectData()
{
- if (!isset($param['username']))
+ if (!isset($param['username']['value']))
{
$this->returnClientError('You must specify a username (?username=...).');
}
- $this->request = $param['username'];
+ $this->request = $param['username']['value'];
// get content parsed
// $html = $this->getSimpleHTMLDOM(__DIR__ . '/../posts2.html'
$html = $this->getSimpleHTMLDOM(self::GOOGLE_PLUS_BASE_URL . urlencode($this->request) . '/posts'
diff --git a/bridges/GoogleSearchBridge.php b/bridges/GoogleSearchBridge.php
index a3746404..5585cea2 100644
--- a/bridges/GoogleSearchBridge.php
+++ b/bridges/GoogleSearchBridge.php
@@ -25,11 +25,12 @@ class GoogleSearchBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (isset($param['q'])) { /* keyword search mode */
- $this->request = $param['q'];
+ if (isset($param['q']['value'])) { /* keyword search mode */
+ $this->request = $param['q']['value'];
$html = $this->getSimpleHTMLDOM('https://www.google.com/search?q=' . urlencode($this->request) . '&num=100&complete=0&tbs=qdr:y,sbd:1') or $this->returnServerError('No results for this query.');
}
else{
diff --git a/bridges/GuruMedBridge.php b/bridges/GuruMedBridge.php
index a58ee643..65617559 100644
--- a/bridges/GuruMedBridge.php
+++ b/bridges/GuruMedBridge.php
@@ -14,7 +14,7 @@ class GuruMedBridge extends BridgeAbstract{
return $string;
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://gurumed.org/feed') or $this->returnServerError('Could not request Gurumed.');
$limit = 0;
diff --git a/bridges/HDWallpapersBridge.php b/bridges/HDWallpapersBridge.php
index 1aa8ff78..4aeb5961 100644
--- a/bridges/HDWallpapersBridge.php
+++ b/bridges/HDWallpapersBridge.php
@@ -21,12 +21,13 @@ class HDWallpapersBridge extends BridgeAbstract {
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$baseUri = 'http://www.hdwallpapers.in';
- $this->category = $param['c'] ?: 'latest_wallpapers'; // Latest default
- $this->resolution = $param['r'] ?: '1920x1200'; // Wide wallpaper default
+ $this->category = $param['c']['value'] ?: 'latest_wallpapers'; // Latest default
+ $this->resolution = $param['r']['value'] ?: '1920x1200'; // Wide wallpaper default
$category = $this->category;
if (strrpos($category, 'wallpapers') !== strlen($category)-strlen('wallpapers')) {
@@ -34,7 +35,7 @@ class HDWallpapersBridge extends BridgeAbstract {
}
$num = 0;
- $max = $param['m'] ?: 14;
+ $max = $param['m']['value'] ?: 14;
$lastpage = 1;
for ($page = 1; $page <= $lastpage; $page++) {
diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php
index 28f69750..22381924 100644
--- a/bridges/HentaiHavenBridge.php
+++ b/bridges/HentaiHavenBridge.php
@@ -10,7 +10,7 @@ class HentaiHavenBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://hentaihaven.org/') or $this->returnServerError('Could not request Hentai Haven.');
foreach($html->find('div.zoe-grid') as $element) {
$item = array();
diff --git a/bridges/IdenticaBridge.php b/bridges/IdenticaBridge.php
index 64f5a6c7..a9d30173 100644
--- a/bridges/IdenticaBridge.php
+++ b/bridges/IdenticaBridge.php
@@ -19,10 +19,11 @@ class IdenticaBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (isset($param['u'])) { /* user timeline mode */
- $this->request = $param['u'];
+ if (isset($param['u']['value'])) { /* user timeline mode */
+ $this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('https://identi.ca/'.urlencode($this->request)) or $this->returnServerError('Requested username can\'t be found.');
}
else {
@@ -34,7 +35,7 @@ class IdenticaBridge extends BridgeAbstract{
$item['uri'] = html_entity_decode($dent->find('a', 0)->href); // get dent link
$item['timestamp'] = strtotime($dent->find('abbr.easydate', 0)->plaintext); // extract dent timestamp
$item['content'] = trim($dent->find('div.activity-content', 0)->innertext); // extract dent text
- $item['title'] = $param['u'] . ' | ' . $item['content'];
+ $item['title'] = $param['u']['value'] . ' | ' . $item['content'];
$this->items[] = $item;
}
}
diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php
index 9e99dc42..85709474 100644
--- a/bridges/InstagramBridge.php
+++ b/bridges/InstagramBridge.php
@@ -16,10 +16,11 @@ class InstagramBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (isset($param['u'])) { /* user timeline mode */
- $this->request = $param['u'];
+ if (isset($param['u']['value'])) { /* user timeline mode */
+ $this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://instagram.com/'.urlencode($this->request)) or $this->returnServerError('Could not request Instagram.');
}
else {
diff --git a/bridges/IsoHuntBridge.php b/bridges/IsoHuntBridge.php
index ac32752f..bfeb2fd9 100644
--- a/bridges/IsoHuntBridge.php
+++ b/bridges/IsoHuntBridge.php
@@ -89,23 +89,24 @@ class IsoHuntBridge extends BridgeAbstract{
);
}
- public function collectData(array $params){
+ public function collectData(){
+ $params=$this->parameters[$this->queriedContext];
$request_path = '/'; // We'll request the main page by default
- if(isset($params['latest_category'])){ // Requesting one of the latest categories
- $this->request_latest_category($params['latest_category']);
- } elseif(isset($params['torrent_category'])){ // Requesting one of the torrent categories
+ if(isset($params['latest_category']['value'])){ // Requesting one of the latest categories
+ $this->request_latest_category($params['latest_category']['value']);
+ } elseif(isset($params['torrent_category']['value'])){ // Requesting one of the torrent categories
$order_popularity = false;
- if(isset($params['torrent_popularity']))
- $order_popularity = $params['torrent_popularity'] === "on";
+ if(isset($params['torrent_popularity']['value']))
+ $order_popularity = $params['torrent_popularity']['value'];
- $this->request_torrent_category($params['torrent_category'], $order_popularity);
- } else if(isset($params['search_name'])){ // Requesting search
- if(isset($params['search_category']))
- $this->request_search($params['search_name'], $params['search_category']);
+ $this->request_torrent_category($params['torrent_category']['value'], $order_popularity);
+ } else if(isset($params['search_name']['value'])){ // Requesting search
+ if(isset($params['search_category']['value']))
+ $this->request_search($params['search_name']['value'], $params['search_category']['value']);
else
- $this->request_search($params['search_name']);
+ $this->request_search($params['search_name']['value']);
} else {
$this->returnClientError('Unknown request!');
}
diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php
index 125261f2..7ac1f8a7 100644
--- a/bridges/JapanExpoBridge.php
+++ b/bridges/JapanExpoBridge.php
@@ -18,7 +18,8 @@ class JapanExpoBridge extends BridgeAbstract{
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
function french_pubdate_to_timestamp($date_to_parse) {
return strtotime(
@@ -50,7 +51,7 @@ class JapanExpoBridge extends BridgeAbstract{
$link = 'http://www.japan-expo-paris.com/fr/actualites';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request JapanExpo: '.$link);
- $fullcontent = (!empty($param['mode']) && $param['mode'] == 'full');
+ $fullcontent = (!empty($param['mode']['value']) && $param['mode']['value'] == 'full');
$count = 0;
foreach ($html->find('a._tile2') as $element) {
diff --git a/bridges/KonachanBridge.php b/bridges/KonachanBridge.php
index b9ef3072..1ae4fff3 100644
--- a/bridges/KonachanBridge.php
+++ b/bridges/KonachanBridge.php
@@ -17,13 +17,14 @@ class KonachanBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://konachan.com/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Konachan.');
$input_json = explode('Post.register(', $html);
diff --git a/bridges/KoreusBridge.php b/bridges/KoreusBridge.php
index d211edfc..66fe3733 100644
--- a/bridges/KoreusBridge.php
+++ b/bridges/KoreusBridge.php
@@ -21,7 +21,7 @@ class KoreusBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://feeds.feedburner.com/Koreus-articles') or $this->returnServerError('Could not request Koreus.');
$limit = 0;
diff --git a/bridges/KununuBridge.php b/bridges/KununuBridge.php
index 0902d200..9e08e917 100644
--- a/bridges/KununuBridge.php
+++ b/bridges/KununuBridge.php
@@ -39,21 +39,22 @@ class KununuBridge extends BridgeAbstract{
);
}
- public function collectData(array $params){
+ public function collectData(){
+ $params=$this->parameters[$this->queriedContext];
// Get Site
- $site = strtolower(trim($params['site']));
+ $site = strtolower(trim($params['site']['value']));
if(!isset($site) || empty($site) || !$this->site_is_valid($site))
$this->returnClientError('You must specify a valid site (&site=...)!');
// Get Company (fixing whitespace and umlauts)
- $company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($params['company']))));
+ $company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($params['company']['value']))));
if(!isset($company) || empty($company))
$this->returnClientError('You must specify a company (&company=...)!');
$full = false; // By default we'll load only short article
- if(isset($params['full']))
- $full = strtolower(trim($params['full'])) === 'on';
+ if(isset($params['full']['value']))
+ $full = strtolower(trim($params['full']['value'])) === 'on';
// Get reviews section name (depends on site)
$section = '';
diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php
index fc61d057..32a79447 100644
--- a/bridges/LWNprevBridge.php
+++ b/bridges/LWNprevBridge.php
@@ -35,7 +35,7 @@ class LWNprevBridge extends BridgeAbstract{
}
}
- public function collectData(array $param){
+ public function collectData(){
// Because the LWN page is written in loose HTML and not XHTML,
// Simple HTML Dom is not accurate enough for the job
diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php
index e71ba4aa..855600fe 100755
--- a/bridges/LeBonCoinBridge.php
+++ b/bridges/LeBonCoinBridge.php
@@ -138,14 +138,15 @@ class LeBonCoinBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (empty($param['c'])) {
- $link = 'http://www.leboncoin.fr/annonces/offres/' . $param['r'] . '/?f=a&th=1&q=' . urlencode($param['k']);
+ if (empty($param['c']['value'])) {
+ $link = 'http://www.leboncoin.fr/annonces/offres/' . $param['r']['value'] . '/?f=a&th=1&q=' . urlencode($param['k']['value']);
}
else {
- $link = 'http://www.leboncoin.fr/' . $param['c'] . '/offres/' . $param['r'] . '/?f=a&th=1&q=' . urlencode($param['k']);
+ $link = 'http://www.leboncoin.fr/' . $param['c']['value'] . '/offres/' . $param['r']['value'] . '/?f=a&th=1&q=' . urlencode($param['k']['value']);
}
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LeBonCoin.');
diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php
index 84a829a3..19f06e19 100644
--- a/bridges/LeJournalDuGeekBridge.php
+++ b/bridges/LeJournalDuGeekBridge.php
@@ -36,7 +36,7 @@ class LeJournalDuGeekBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
$rssFeed = $this->getSimpleHTMLDOM('http://www.journaldugeek.com/rss') or $this->returnServerError('Could not request http://www.journaldugeek.com/rss');
$limit = 0;
diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php
index 3465be44..e4fbdbcb 100644
--- a/bridges/LeMondeInformatiqueBridge.php
+++ b/bridges/LeMondeInformatiqueBridge.php
@@ -10,7 +10,7 @@ class LeMondeInformatiqueBridge extends BridgeAbstract {
}
- public function collectData(array $param) {
+ public function collectData(){
function StripCDATA($string) {
$string = str_replace('parameters[$this->queriedContext];
parent::collectExpandableDatas($param, SEXE_FEED);
}
diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php
index e9986d88..d3299395 100644
--- a/bridges/LesJoiesDuCodeBridge.php
+++ b/bridges/LesJoiesDuCodeBridge.php
@@ -10,7 +10,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://lesjoiesducode.fr/') or $this->returnServerError('Could not request LesJoiesDuCode.');
foreach($html->find('div.blog-post') as $element) {
diff --git a/bridges/LichessBridge.php b/bridges/LichessBridge.php
index 252fbaec..839b183a 100644
--- a/bridges/LichessBridge.php
+++ b/bridges/LichessBridge.php
@@ -10,7 +10,7 @@ class LichessBridge extends BridgeAbstract
$this->description = 'Returns the 5 newest posts from the Lichess blog (full text)';
}
- public function collectData(array $param)
+ public function collectData()
{
$xml_feed = $this->getSimpleHTMLDOM('http://fr.lichess.org/blog.atom') or $this->returnServerError('Could not retrieve Lichess blog feed.');
diff --git a/bridges/LinkedInCompany.php b/bridges/LinkedInCompany.php
index bf8fd6ac..7640d15b 100644
--- a/bridges/LinkedInCompany.php
+++ b/bridges/LinkedInCompany.php
@@ -16,9 +16,10 @@ class LinkedInCompany extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- $link = 'https://www.linkedin.com/company/'.$param['c'];
+ $link = 'https://www.linkedin.com/company/'.$param['c']['value'];
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LinkedIn.');
diff --git a/bridges/LolibooruBridge.php b/bridges/LolibooruBridge.php
index b91168a3..66892167 100644
--- a/bridges/LolibooruBridge.php
+++ b/bridges/LolibooruBridge.php
@@ -17,13 +17,14 @@ class LolibooruBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 1; $tags = '';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://lolibooru.moe/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Lolibooru.');
$input_json = explode('Post.register(', $html);
diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php
index b2b5902a..59cb0649 100644
--- a/bridges/MangareaderBridge.php
+++ b/bridges/MangareaderBridge.php
@@ -76,7 +76,8 @@ class MangareaderBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$this->request = '';
@@ -84,21 +85,21 @@ class MangareaderBridge extends BridgeAbstract{
$path = "latest";
$limit = MANGAREADER_LIMIT;
- if(isset($param['category'])){ // Get popular updates
+ if(isset($param['category']['value'])){ // Get popular updates
$type = "popular";
$path = "popular";
- if($param['category'] !== "all"){
- $path .= "/" . $param['category'];
+ if($param['category']['value'] !== "all"){
+ $path .= "/" . $param['category']['value'];
}
}
- if(isset($param['path'])){ // Get manga updates
+ if(isset($param['path']['value'])){ // Get manga updates
$type = "path";
- $path = $param['path'];
+ $path = $param['path']['value'];
}
- if(isset($param['limit']) && $param['limit'] !== ""){ // Get manga updates (optional parameter)
- $limit = $param['limit'];
+ if(isset($param['limit']['value']) && $param['limit']['value'] !== ""){ // Get manga updates (optional parameter)
+ $limit = $param['limit']['value'];
}
// We'll use the DOM parser for this as it makes navigation easier
diff --git a/bridges/MilbooruBridge.php b/bridges/MilbooruBridge.php
index 8c081712..58b539f8 100644
--- a/bridges/MilbooruBridge.php
+++ b/bridges/MilbooruBridge.php
@@ -17,13 +17,14 @@ class MilbooruBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://sheslostcontrol.net/moe/shimmie/index.php?q=/post/list/$tags/$page") or $this->returnServerError('Could not request Milbooru.');
diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php
index bc033346..0bbab2a2 100644
--- a/bridges/MondeDiploBridge.php
+++ b/bridges/MondeDiploBridge.php
@@ -8,7 +8,7 @@ class MondeDiploBridge extends BridgeAbstract{
$this->description = "Returns most recent results from MondeDiplo.";
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request MondeDiplo. for : ' . $link);
foreach($html->find('div.unarticle') as $article) {
diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php
index 5d7d48d1..e4af1374 100644
--- a/bridges/MsnMondeBridge.php
+++ b/bridges/MsnMondeBridge.php
@@ -14,7 +14,7 @@ class MsnMondeBridge extends BridgeAbstract{
$item['timestamp'] = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request MsnMonde.');
$limit = 0;
foreach($html->find('.smalla') as $article) {
diff --git a/bridges/MspabooruBridge.php b/bridges/MspabooruBridge.php
index 6528b3ca..5a7f8a2b 100644
--- a/bridges/MspabooruBridge.php
+++ b/bridges/MspabooruBridge.php
@@ -18,15 +18,16 @@ class MspabooruBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 50;
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://mspabooru.com/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Mspabooru.');
diff --git a/bridges/NakedSecurityBridge.php b/bridges/NakedSecurityBridge.php
index 4020b708..0ad8370b 100644
--- a/bridges/NakedSecurityBridge.php
+++ b/bridges/NakedSecurityBridge.php
@@ -8,7 +8,7 @@ class NakedSecurityBridge extends BridgeAbstract {
$this->description = 'Returns the newest articles.';
}
- public function collectData(array $param) {
+ public function collectData(){
function StripRecursiveHTMLSection($string, $tag_name, $tag_start) {
$open_tag = '<'.$tag_name;
diff --git a/bridges/NasaApodBridge.php b/bridges/NasaApodBridge.php
index c8b36c3d..2209c4d3 100644
--- a/bridges/NasaApodBridge.php
+++ b/bridges/NasaApodBridge.php
@@ -10,7 +10,7 @@ class NasaApodBridge extends BridgeAbstract{
}
- public function collectData(array $param) {
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://apod.nasa.gov/apod/archivepix.html') or $this->returnServerError('Error while downloading the website content');
$list = explode("
", $html->find('b', 0)->innertext);
diff --git a/bridges/NeuviemeArtBridge.php b/bridges/NeuviemeArtBridge.php
index fa6c8c7a..0d7ae981 100644
--- a/bridges/NeuviemeArtBridge.php
+++ b/bridges/NeuviemeArtBridge.php
@@ -8,7 +8,7 @@ class NeuviemeArtBridge extends BridgeAbstract {
$this->description = "Returns the newest articles.";
}
- public function collectData(array $param) {
+ public function collectData(){
function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php
index b04b972e..93b3a819 100644
--- a/bridges/NextInpactBridge.php
+++ b/bridges/NextInpactBridge.php
@@ -25,7 +25,7 @@ class NextInpactBridge extends BridgeAbstract {
return $text;
}
- public function collectData(array $param) {
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.nextinpact.com/rss/news.xml') or $this->returnServerError('Could not request NextInpact.');
$limit = 0;
diff --git a/bridges/NextgovBridge.php b/bridges/NextgovBridge.php
index 684df8b8..196c0fac 100644
--- a/bridges/NextgovBridge.php
+++ b/bridges/NextgovBridge.php
@@ -28,7 +28,8 @@ class NextgovBridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@@ -46,7 +47,7 @@ class NextgovBridge extends BridgeAbstract {
} return $string;
}
- $category = $param['category'];
+ $category = $param['category']['value'];
if (empty($category))
$category = 'all';
if ($category !== preg_replace('/[^a-z-]+/', '', $category) || strlen($category > 32))
diff --git a/bridges/NiceMatinBridge.php b/bridges/NiceMatinBridge.php
index 30a1f346..d56fc275 100644
--- a/bridges/NiceMatinBridge.php
+++ b/bridges/NiceMatinBridge.php
@@ -22,7 +22,7 @@ class NiceMatinBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.nicematin.com/derniere-minute/rss') or $this->returnServerError('Could not request NiceMatin.');
$limit = 0;
diff --git a/bridges/NovelUpdatesBridge.php b/bridges/NovelUpdatesBridge.php
index 0bf451a7..84da2a9d 100644
--- a/bridges/NovelUpdatesBridge.php
+++ b/bridges/NovelUpdatesBridge.php
@@ -15,10 +15,11 @@ class NovelUpdatesBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
- if (!isset($param['n']))
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ if (!isset($param['n']['value']))
$this->returnClientError('You must specify the novel URL (/series/...)');
- $thread = parse_url($param['n']) or $this->returnClientError('This URL seems malformed, please check it.');
+ $thread = parse_url($param['n']['value']) or $this->returnClientError('This URL seems malformed, please check it.');
if($thread['host'] !== 'www.novelupdates.com')
$this->returnClientError('NovelUpdates URL only.');
if(strpos($thread['path'], 'series/') === FALSE)
diff --git a/bridges/NumeramaBridge.php b/bridges/NumeramaBridge.php
index d3bf5484..d9ae0835 100644
--- a/bridges/NumeramaBridge.php
+++ b/bridges/NumeramaBridge.php
@@ -10,7 +10,7 @@ class NumeramaBridge extends BridgeAbstract{
}
- public function collectData(array $param) {
+ public function collectData(){
function NumeramaStripCDATA($string) {
$string = str_replace('parameters[$this->queriedContext];
+ if (empty($param['u']['value']))
{
$this->returnServerError('Error: You must chose a category.');
}
$html = '';
- $link = 'https://openclassrooms.com/courses?categories='.$param['u'].'&title=&sort=updatedAt+desc';
+ $link = 'https://openclassrooms.com/courses?categories='.$param['u']['value'].'&title=&sort=updatedAt+desc';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request OpenClassrooms.');
diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php
index 528cde1c..345ef97d 100644
--- a/bridges/ParuVenduImmoBridge.php
+++ b/bridges/ParuVenduImmoBridge.php
@@ -29,7 +29,7 @@ class ParuVenduImmoBridge extends BridgeAbstract
);
}
- public function collectData(array $param)
+ public function collectData()
{
$html = '';
$num = 20;
@@ -37,22 +37,22 @@ class ParuVenduImmoBridge extends BridgeAbstract
$maison = '&tbMai=1&tbVil=1&tbCha=1&tbPro=1&tbHot=1&tbMou=1&tbFer=1';
$link = $this->uri.'/immobilier/annonceimmofo/liste/listeAnnonces?tt=1'.$appartment.$maison;
- if (isset($param['minarea'])) {
- $this->request .= ' '.$param['minarea'].' m2';
- $link .= '&sur0='.urlencode($param['minarea']);
+ if (isset($param['minarea']['value'])) {
+ $this->request .= ' '.$param['minarea']['value'].' m2';
+ $link .= '&sur0='.urlencode($param['minarea']['value']);
}
- if (isset($param['maxprice'])) {
- $link .= '&px1='.urlencode($param['maxprice']);
+ if (isset($param['maxprice']['value'])) {
+ $link .= '&px1='.urlencode($param['maxprice']['value']);
}
- if (isset($param['pa'])) {
- $link .= '&pa='.urlencode($param['pa']);
+ if (isset($param['pa']['value'])) {
+ $link .= '&pa='.urlencode($param['pa']['value']);
}
- if (isset($param['lo'])) {
- $this->request .= ' In: '.$param['lo'];
- $link .= '&lo='.urlencode($param['lo']);
+ if (isset($param['lo']['value'])) {
+ $this->request .= ' In: '.$param['lo']['value'];
+ $link .= '&lo='.urlencode($param['lo']['value']);
}
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request paruvendu.');
diff --git a/bridges/PickyWallpapersBridge.php b/bridges/PickyWallpapersBridge.php
index b3512914..b35c9c36 100644
--- a/bridges/PickyWallpapersBridge.php
+++ b/bridges/PickyWallpapersBridge.php
@@ -28,19 +28,20 @@ class PickyWallpapersBridge extends BridgeAbstract {
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (!isset($param['c'])) {
+ if (!isset($param['c']['value'])) {
$this->returnClientError('You must specify at least a category (?c=...).');
} else {
$baseUri = 'http://www.pickywallpapers.com';
- $this->category = $param['c'];
- $this->subcategory = $param['s'] ?: '';
- $this->resolution = $param['r'] ?: '1920x1200'; // Wide wallpaper default
+ $this->category = $param['c']['value'];
+ $this->subcategory = $param['s']['value'] ?: '';
+ $this->resolution = $param['r']['value'] ?: '1920x1200'; // Wide wallpaper default
$num = 0;
- $max = $param['m'] ?: 12;
+ $max = $param['m']['value'] ?: 12;
$lastpage = 1;
for ($page = 1; $page <= $lastpage; $page++) {
diff --git a/bridges/PinterestBridge.php b/bridges/PinterestBridge.php
index eb33607d..f82c7c71 100644
--- a/bridges/PinterestBridge.php
+++ b/bridges/PinterestBridge.php
@@ -22,27 +22,28 @@ class PinterestBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if (isset($param['u']) || isset($param['b'])) {
+ if (isset($param['u']['value']) || isset($param['b']['value'])) {
- if (empty($param['u']))
+ if (empty($param['u']['value']))
{
$this->returnClientError('You must specify a Pinterest username (?u=...).');
}
- if (empty($param['b']))
+ if (empty($param['b']['value']))
{
$this->returnClientError('You must specify a Pinterest board for this username (?b=...).');
}
- $this->username = $param['u'];
- $this->board = $param['b'];
+ $this->username = $param['u']['value'];
+ $this->board = $param['b']['value'];
$html = $this->getSimpleHTMLDOM($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnServerError('Username and/or board not found');
- } else if (isset($param['q']))
+ } else if (isset($param['q']['value']))
{
- $this->query = $param['q'];
+ $this->query = $param['q']['value'];
$html = $this->getSimpleHTMLDOM($this->getURI().'/search/?q='.urlencode($this->query)) or $this->returnServerError('Could not request Pinterest.');
}
diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php
index 5c1c9bbc..02e95355 100644
--- a/bridges/PlanetLibreBridge.php
+++ b/bridges/PlanetLibreBridge.php
@@ -14,7 +14,7 @@ class PlanetLibreBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.planet-libre.org/') or $this->returnServerError('Could not request PlanetLibre.');
$limit = 0;
foreach($html->find('div.post') as $element) {
diff --git a/bridges/ProjectMGameBridge.php b/bridges/ProjectMGameBridge.php
index 02fc621a..b6dacbd8 100644
--- a/bridges/ProjectMGameBridge.php
+++ b/bridges/ProjectMGameBridge.php
@@ -11,7 +11,7 @@ class ProjectMGameBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM('http://projectmgame.com/en/') or $this->returnServerError('Error while downloading the Project M homepage');
diff --git a/bridges/RTBFBridge.php b/bridges/RTBFBridge.php
index 5abea302..561bcc56 100644
--- a/bridges/RTBFBridge.php
+++ b/bridges/RTBFBridge.php
@@ -15,13 +15,14 @@ class RTBFBridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$limit = 10;
$count = 0;
- if (isset($param['c'])) {
- $html = $this->getSimpleHTMLDOM('http://www.rtbf.be/auvio/emissions/detail?id='.$param['c']) or $this->returnServerError('Could not request RTBF.');
+ if (isset($param['c']['value'])) {
+ $html = $this->getSimpleHTMLDOM('http://www.rtbf.be/auvio/emissions/detail?id='.$param['c']['value']) or $this->returnServerError('Could not request RTBF.');
foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) {
if($count < $limit) {
diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php
index 2cff757b..fb85fcb4 100644
--- a/bridges/Releases3DSBridge.php
+++ b/bridges/Releases3DSBridge.php
@@ -10,7 +10,7 @@ class Releases3DSBridge extends BridgeAbstract {
}
- public function collectData(array $param) {
+ public function collectData(){
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
diff --git a/bridges/ReporterreBridge.php b/bridges/ReporterreBridge.php
index 3c1672bc..e3103443 100644
--- a/bridges/ReporterreBridge.php
+++ b/bridges/ReporterreBridge.php
@@ -25,7 +25,7 @@ class ReporterreBridge extends BridgeAbstract{
return $text;
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.reporterre.net/spip.php?page=backend') or $this->returnServerError('Could not request Reporterre.');
$limit = 0;
diff --git a/bridges/Rue89Bridge.php b/bridges/Rue89Bridge.php
index 76da28e9..39c6c4fc 100644
--- a/bridges/Rue89Bridge.php
+++ b/bridges/Rue89Bridge.php
@@ -19,7 +19,7 @@ class Rue89Bridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://api.rue89.nouvelobs.com/feed') or $this->returnServerError('Could not request Rue89.');
diff --git a/bridges/Rule34Bridge.php b/bridges/Rule34Bridge.php
index e0bc4f1f..12c69259 100644
--- a/bridges/Rule34Bridge.php
+++ b/bridges/Rule34Bridge.php
@@ -18,15 +18,16 @@ class Rule34Bridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 50;
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://rule34.xxx/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Rule34.');
diff --git a/bridges/Rule34pahealBridge.php b/bridges/Rule34pahealBridge.php
index dc569654..76605c66 100644
--- a/bridges/Rule34pahealBridge.php
+++ b/bridges/Rule34pahealBridge.php
@@ -18,13 +18,14 @@ class Rule34pahealBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://rule34.paheal.net/post/list/$tags/$page") or $this->returnServerError('Could not request Rule34paheal.');
diff --git a/bridges/SafebooruBridge.php b/bridges/SafebooruBridge.php
index 3d3b6387..a6d98919 100644
--- a/bridges/SafebooruBridge.php
+++ b/bridges/SafebooruBridge.php
@@ -18,15 +18,16 @@ class SafebooruBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 40;
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://safebooru.org/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Safebooru.');
diff --git a/bridges/SakugabooruBridge.php b/bridges/SakugabooruBridge.php
index 03e44ac9..2a386013 100644
--- a/bridges/SakugabooruBridge.php
+++ b/bridges/SakugabooruBridge.php
@@ -18,13 +18,14 @@ class SakugabooruBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://sakuga.yshi.org/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Sakugabooru.');
$input_json = explode('Post.register(', $html);
diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php
index 13286f90..c1d6031b 100644
--- a/bridges/ScmbBridge.php
+++ b/bridges/ScmbBridge.php
@@ -10,7 +10,7 @@ class ScmbBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM('http://secouchermoinsbete.fr/') or $this->returnServerError('Could not request Se Coucher Moins Bete.');
diff --git a/bridges/ScoopItBridge.php b/bridges/ScoopItBridge.php
index adb49ee6..6a233d44 100644
--- a/bridges/ScoopItBridge.php
+++ b/bridges/ScoopItBridge.php
@@ -17,10 +17,11 @@ class ScoopItBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- if ($param['u'] != '') {
- $this->request = $param['u'];
+ if ($param['u']['value'] != '') {
+ $this->request = $param['u']['value'];
$link = 'http://scoop.it/search?q=' .urlencode($this->request);
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request ScoopIt. for : ' . $link);
diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php
index c400106e..0e44bdca 100644
--- a/bridges/SensCritiqueBridge.php
+++ b/bridges/SensCritiqueBridge.php
@@ -37,18 +37,19 @@ class SensCritiqueBridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
- if ((isset($param['m']) && $param['m'])) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
+ if ((isset($param['m']['value']) && $param['m']['value'])) {
$this->collectMoviesData();
- } else if ((isset($param['s']) && $param['s'])) {
+ } else if ((isset($param['s']['value']) && $param['s']['value'])) {
$this->collectSeriesData();
- } else if ((isset($param['g']) && $param['g'])) {
+ } else if ((isset($param['g']['value']) && $param['g']['value'])) {
$this->collectGamesData();
- } else if ((isset($param['b']) && $param['b'])) {
+ } else if ((isset($param['b']['value']) && $param['b']['value'])) {
$this->collectBooksData();
- } else if ((isset($param['bd']) && $param['bd'])) {
+ } else if ((isset($param['bd']['value']) && $param['bd']['value'])) {
$this->collectBDsData();
- } else if ((isset($param['mu']) && $param['mu'])) {
+ } else if ((isset($param['mu']['value']) && $param['mu']['value'])) {
$this->collectMusicsData();
} else {
$this->returnClientError('You must choose a category');
diff --git a/bridges/Sexactu.php b/bridges/Sexactu.php
index 65305c79..839f6dd8 100644
--- a/bridges/Sexactu.php
+++ b/bridges/Sexactu.php
@@ -10,7 +10,7 @@ class Sexactu extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$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/ShanaprojectBridge.php b/bridges/ShanaprojectBridge.php
index 641e4fa2..5abc31f8 100644
--- a/bridges/ShanaprojectBridge.php
+++ b/bridges/ShanaprojectBridge.php
@@ -91,7 +91,7 @@ class ShanaprojectBridge extends BridgeAbstract {
';
}
- public function collectData (array $param){
+ public function collectData(){
$html = $this->LoadSeasonAnimeList();
$animes = $html->find('div.header_display_box_info');
diff --git a/bridges/SiliconBridge.php b/bridges/SiliconBridge.php
index 1ef075a0..be064688 100644
--- a/bridges/SiliconBridge.php
+++ b/bridges/SiliconBridge.php
@@ -10,7 +10,7 @@ class SiliconBridge extends BridgeAbstract {
}
- public function collectData(array $param) {
+ public function collectData(){
function StripCDATA($string) {
$string = str_replace('parameters[$this->queriedContext];
- if (isset($param['u']) && !empty($param['u']))
+ if (isset($param['u']['value']) && !empty($param['u']['value']))
{
- $this->request = $param['u'];
+ $this->request = $param['u']['value'];
$res = json_decode($this->getContents('https://api.soundcloud.com/resolve?url=http://www.soundcloud.com/'. urlencode($this->request) .'&client_id=' . self::CLIENT_ID)) or $this->returnServerError('No results for this query');
$tracks = json_decode($this->getContents('https://api.soundcloud.com/users/'. urlencode($res->id) .'/tracks?client_id=' . self::CLIENT_ID)) or $this->returnServerError('No results for this user');
diff --git a/bridges/StripeAPIChangeLogBridge.php b/bridges/StripeAPIChangeLogBridge.php
index f6aa7c99..107a9d33 100644
--- a/bridges/StripeAPIChangeLogBridge.php
+++ b/bridges/StripeAPIChangeLogBridge.php
@@ -14,7 +14,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{
$this->description = 'Returns the changes made to the stripe.com API';
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('https://stripe.com/docs/upgrades')
or $this->returnServerError('No results for Stripe API Changelog');
diff --git a/bridges/SuperbWallpapersBridge.php b/bridges/SuperbWallpapersBridge.php
index f8382066..a5146da9 100644
--- a/bridges/SuperbWallpapersBridge.php
+++ b/bridges/SuperbWallpapersBridge.php
@@ -26,15 +26,16 @@ class SuperbWallpapersBridge extends BridgeAbstract {
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
$baseUri = 'http://www.superbwallpapers.com';
- $this->category = $param['c'] ?: ''; // All default
- $this->resolution = $param['r'] ?: '1920x1200'; // Wide wallpaper default
+ $this->category = $param['c']['value'] ?: ''; // All default
+ $this->resolution = $param['r']['value'] ?: '1920x1200'; // Wide wallpaper default
$num = 0;
- $max = $param['m'] ?: 36;
+ $max = $param['m']['value'] ?: 36;
$lastpage = 1;
// Get last page number
diff --git a/bridges/T411Bridge.php b/bridges/T411Bridge.php
index 35c73f5a..6791bfaa 100644
--- a/bridges/T411Bridge.php
+++ b/bridges/T411Bridge.php
@@ -16,7 +16,8 @@ class T411Bridge extends BridgeAbstract {
);
}
- public function collectData(array $param) {
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
//Utility function for retrieving text based on start and end delimiters
function ExtractFromDelimiters($string, $start, $end) {
@@ -28,12 +29,12 @@ class T411Bridge extends BridgeAbstract {
}
//Ensure proper parameters have been provided
- if (empty($param['search'])) {
+ if (empty($param['search']['value'])) {
$this->returnClientError('You must specify a search criteria');
}
//Retrieve torrent listing from search results, which does not contain torrent description
- $url = $this->uri.'torrents/search/?'.$param['search'].'&order=added&type=desc';
+ $url = $this->uri.'torrents/search/?'.$param['search']['value'].'&order=added&type=desc';
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request t411: '.$url);
$results = $html->find('table.results', 0);
if (is_null($results))
diff --git a/bridges/TagBoardBridge.php b/bridges/TagBoardBridge.php
index 2467f6c7..a9418dbb 100644
--- a/bridges/TagBoardBridge.php
+++ b/bridges/TagBoardBridge.php
@@ -17,9 +17,10 @@ class TagBoardBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$html = '';
- $this->request = $param['u'];
+ $this->request = $param['u']['value'];
$link = 'https://post-cache.tagboard.com/search/' .$this->request;
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request TagBoard for : ' . $link);
diff --git a/bridges/TbibBridge.php b/bridges/TbibBridge.php
index 1d58d5ca..a7e0a72d 100644
--- a/bridges/TbibBridge.php
+++ b/bridges/TbibBridge.php
@@ -17,15 +17,16 @@ class TbibBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
- if (isset($param['p'])) {
- $page = (int)preg_replace("/[^0-9]/",'', $param['p']);
+ if (isset($param['p']['value'])) {
+ $page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 50;
}
- if (isset($param['t'])) {
- $tags = urlencode($param['t']);
+ if (isset($param['t']['value'])) {
+ $tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://tbib.org/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Tbib.');
diff --git a/bridges/TheCodingLoveBridge.php b/bridges/TheCodingLoveBridge.php
index 704f5ec4..aae75c0e 100644
--- a/bridges/TheCodingLoveBridge.php
+++ b/bridges/TheCodingLoveBridge.php
@@ -10,7 +10,7 @@ class TheCodingLoveBridge extends BridgeAbstract{
}
- public function collectData(array $param){
+ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://thecodinglove.com/') or $this->returnServerError('Could not request The Coding Love.');
foreach($html->find('div.post') as $element) {
diff --git a/bridges/TheHackerNewsBridge.php b/bridges/TheHackerNewsBridge.php
index 118c6754..932efe1c 100644
--- a/bridges/TheHackerNewsBridge.php
+++ b/bridges/TheHackerNewsBridge.php
@@ -10,7 +10,7 @@ class TheHackerNewsBridge extends BridgeAbstract {
}
- public function collectData(array $param) {
+ public function collectData(){
function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
diff --git a/bridges/TheOatMealBridge.php b/bridges/TheOatMealBridge.php
index a7bf308a..9cb7caa7 100644
--- a/bridges/TheOatMealBridge.php
+++ b/bridges/TheOatMealBridge.php
@@ -13,7 +13,8 @@ class TheOatmealBridge extends RssExpander{
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
parent::collectExpandableDatas($param, THE_OATMEAL_RSS);
}
diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php
index 16bbe597..5b995e2b 100644
--- a/bridges/ThePirateBayBridge.php
+++ b/bridges/ThePirateBayBridge.php
@@ -16,7 +16,8 @@ class ThePirateBayBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
function parseDateTimestamp($element){
$guessedDate = $element->find('font',0)->plaintext;
@@ -52,10 +53,10 @@ class ThePirateBayBridge extends BridgeAbstract{
}
- if (!isset($param['q']))
+ if (!isset($param['q']['value']))
$this->returnClientError('You must specify keywords (?q=...)');
- $keywordsList = explode(";",$param['q']);
+ $keywordsList = explode(";",$param['q']['value']);
foreach($keywordsList as $keywords){
$html = $this->getSimpleHTMLDOM('https://thepiratebay.org/search/'.rawurlencode($keywords).'/0/3/0') or $this->returnServerError('Could not request TPB.');
diff --git a/bridges/TwitchApiBridge.php b/bridges/TwitchApiBridge.php
index 898145b1..1214b317 100644
--- a/bridges/TwitchApiBridge.php
+++ b/bridges/TwitchApiBridge.php
@@ -49,7 +49,8 @@ class TwitchApiBridge extends BridgeAbstract{
);
}
- public function collectData(array $param){
+ public function collectData(){
+ $param=$this->parameters[$this->queriedContext];
/* In accordance with API description:
* "When specifying a version for a request to the Twitch API, set the Accept HTTP header to the API version you prefer."
@@ -68,19 +69,19 @@ class TwitchApiBridge extends BridgeAbstract{
$broadcasts = TWITCH_BROADCASTS;
$requests = 1;
- if(isset($param['channel'])) {
- $channel = $param['channel'];
+ if(isset($param['channel']['value'])) {
+ $channel = $param['channel']['value'];
} else {
- $this->returnClientError('You must specify a valid channel name! Received: &channel=' . $param['channel']);
+ $this->returnClientError('You must specify a valid channel name! Received: &channel=' . $param['channel']['value']);
}
$this->channel = $channel;
- if(isset($param['limit'])) {
+ if(isset($param['limit']['value'])) {
try {
- $limit = (int)$param['limit'];
+ $limit = (int)$param['limit']['value'];
} catch (Exception $e){
- $this->returnClientError('The limit you specified is not valid! Received: &limit=' . $param['limit'] . ' Expected: &limit=