diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php
index 51a767a..741d92c 100644
--- a/bridges/ABCTabsBridge.php
+++ b/bridges/ABCTabsBridge.php
@@ -1,10 +1,10 @@
array(
'name'=>'category',
'type'=>'list',
@@ -38,10 +38,10 @@ class AllocineFRBridge extends BridgeAbstract{
}
public function getName(){
- return $this->name.' : '
+ return self::NAME.' : '
.array_search(
$this->getInput('category'),
- $this->parameters[$this->queriedContext]['category']['values']
+ self::PARAMETERS[$this->queriedContext]['category']['values']
);
}
@@ -52,7 +52,7 @@ class AllocineFRBridge extends BridgeAbstract{
$category=array_search(
$this->getInput('category'),
- $this->parameters[$this->queriedContext]['category']['values']
+ self::PARAMETERS[$this->queriedContext]['category']['values']
);
diff --git a/bridges/AnimeUltimeBridge.php b/bridges/AnimeUltimeBridge.php
index 629f459..301475f 100644
--- a/bridges/AnimeUltimeBridge.php
+++ b/bridges/AnimeUltimeBridge.php
@@ -1,11 +1,11 @@
array(
'name'=>'Type',
'type'=>'list',
@@ -25,7 +25,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
//Add type filter if provided
$typeFilter = array_search(
$this->getInput('type'),
- $this->parameters[$this->queriedContext]['type']['values']
+ self::PARAMETERS[$this->queriedContext]['type']['values']
);
//Build date and filters for making requests
@@ -37,7 +37,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
foreach (array($thismonth, $lastmonth) as $requestFilter) {
//Retrive page contents
- $url = $this->uri.'history-0-1/'.$requestFilter;
+ $url = self::URI.'history-0-1/'.$requestFilter;
$html = $this->getSimpleHTMLDOM($url)
or $this->returnServerError('Could not request Anime-Ultime: '.$url);
@@ -58,7 +58,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
//Retrieve metadata from table columns
$item_link_element = $release->find('td', 0)->find('a', 0);
- $item_uri = $this->uri.$item_link_element->href;
+ $item_uri = self::URI.$item_link_element->href;
$item_name = html_entity_decode($item_link_element->plaintext);
$item_episode = html_entity_decode(str_pad($release->find('td', 1)->plaintext, 2, '0', STR_PAD_LEFT));
$item_fansub = $release->find('td', 2)->plaintext;
@@ -79,7 +79,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
strpos($item_description, '
')
);
$item_description = str_replace(
- 'src="images', 'src="'.$this->uri.'images',
+ 'src="images', 'src="'.self::URI.'images',
$item_description
);
$item_description = str_replace("\r", '', $item_description);
@@ -109,7 +109,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
public function getName() {
$typeFilter = array_search(
$this->getInput('type'),
- $this->parameters[$this->queriedContext]['type']['values']
+ self::PARAMETERS[$this->queriedContext]['type']['values']
);
return 'Latest '.$typeFilter.' - Anime-Ultime Bridge';
diff --git a/bridges/ArstechnicaBridge.php b/bridges/ArstechnicaBridge.php
index d2a62b2..2620715 100644
--- a/bridges/ArstechnicaBridge.php
+++ b/bridges/ArstechnicaBridge.php
@@ -3,10 +3,10 @@
#error_reporting(E_ALL);
class ArstechnicaBridge extends BridgeAbstract {
- public $maintainer = "prysme";
- public $name = "ArstechnicaBridge";
- public $uri = "http://arstechnica.com";
- public $description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";
+ const MAINTAINER = "prysme";
+ const NAME = "ArstechnicaBridge";
+ const URI = "http://arstechnica.com";
+ const DESCRIPTION = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";
function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
diff --git a/bridges/Arte7Bridge.php b/bridges/Arte7Bridge.php
index 19e039f..7080648 100644
--- a/bridges/Arte7Bridge.php
+++ b/bridges/Arte7Bridge.php
@@ -1,11 +1,11 @@
array(
'catfr'=>array(
'type'=>'list',
@@ -56,7 +56,7 @@
break;
}
- $url = $this->uri.'guide/'.$lang.'/plus7/'.$category;
+ $url = self::URI.'guide/'.$lang.'/plus7/'.$category;
$input = $this->getContents($url) or die('Could not request ARTE.');
if(strpos($input, 'categoryVideoSet') !== FALSE){
$input = explode('categoryVideoSet: ', $input);
diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php
index 7a8b9e2..a4c22df 100644
--- a/bridges/AskfmBridge.php
+++ b/bridges/AskfmBridge.php
@@ -1,11 +1,11 @@
array(
'u'=>array(
'name'=>'Username',
@@ -20,7 +20,7 @@ class AskfmBridge extends BridgeAbstract{
foreach($html->find('div.streamItem-answer') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a.streamItemsAge',0)->href;
+ $item['uri'] = self::URI.$element->find('a.streamItemsAge',0)->href;
$question = trim($element->find('h1.streamItemContent-question',0)->innertext);
$item['title'] = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES));
$answer = trim($element->find('p.streamItemContent-answer',0)->innertext);
@@ -35,18 +35,18 @@ class AskfmBridge extends BridgeAbstract{
}
$content = '
' . $question . '
' . $answer . '
' . $visual . '
';
// Fix relative links without breaking // scheme used by YouTube stuff
- $content = preg_replace('#href="\/(?!\/)#', 'href="'.$this->uri,$content);
+ $content = preg_replace('#href="\/(?!\/)#', 'href="'.self::URI,$content);
$item['content'] = $content;
$this->items[] = $item;
}
}
public function getName(){
- return $this->name.' : '.$this->getInput('u');
+ return self::NAME.' : '.$this->getInput('u');
}
public function getURI(){
- return $this->uri.urlencode($this->getInput('u')).'/answers/more?page=0';
+ return self::URI.urlencode($this->getInput('u')).'/answers/more?page=0';
}
public function getCacheDuration(){
diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php
index 4e11091..77b88e6 100644
--- a/bridges/BandcampBridge.php
+++ b/bridges/BandcampBridge.php
@@ -1,11 +1,11 @@
array(
'name'=>'tag',
'type'=>'text',
@@ -33,7 +33,7 @@ class BandcampBridge extends BridgeAbstract{
}
public function getURI(){
- return $this->uri.'tag/'.urlencode($this->getInput('tag')).'?sort_field=date';
+ return self::URI.'tag/'.urlencode($this->getInput('tag')).'?sort_field=date';
}
public function getName(){
diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php
index a7a7c82..be36662 100644
--- a/bridges/BastaBridge.php
+++ b/bridges/BastaBridge.php
@@ -1,17 +1,17 @@
uri.'$1\'', $content);
+ return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.self::URI.'$1\'', $content);
}
- $html = $this->getSimpleHTMLDOM($this->uri.'spip.php?page=backend')
+ $html = $this->getSimpleHTMLDOM(self::URI.'spip.php?page=backend')
or $this->returnServerError('Could not request Bastamag.');
$limit = 0;
diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php
index e0f65e1..0392bed 100644
--- a/bridges/BlaguesDeMerdeBridge.php
+++ b/bridges/BlaguesDeMerdeBridge.php
@@ -1,14 +1,14 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request BDM.');
foreach($html->find('article.joke_contener') as $element) {
diff --git a/bridges/BooruprojectBridge.php b/bridges/BooruprojectBridge.php
index eb3f5ac..635aae5 100644
--- a/bridges/BooruprojectBridge.php
+++ b/bridges/BooruprojectBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'instance (required)',
'required'=>true
diff --git a/bridges/CADBridge.php b/bridges/CADBridge.php
index 8073f86..47ff165 100644
--- a/bridges/CADBridge.php
+++ b/bridges/CADBridge.php
@@ -1,9 +1,9 @@
getSimpleHTMLDOM($url);
diff --git a/bridges/CNETBridge.php b/bridges/CNETBridge.php
index 8a896dc..755033d 100644
--- a/bridges/CNETBridge.php
+++ b/bridges/CNETBridge.php
@@ -1,12 +1,12 @@
You may specify a topic found in some section URLs, else all topics are selected.';
+ const MAINTAINER = 'ORelio';
+ const NAME = 'CNET News';
+ const URI = 'http://www.cnet.com/';
+ const DESCRIPTION = 'Returns the newest articles.
You may specify a topic found in some section URLs, else all topics are selected.';
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'topic'=>array('name'=>'Topic name')
));
@@ -37,8 +37,7 @@ class CNETBridge extends BridgeAbstract {
return $article_html;
}
- $topic=$this->getInput('topic');
- $pageUrl = $this->uri.(empty($topic) ? '' : 'topics/'.$topic.'/');
+ $pageUrl = self::URI.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$limit = 0;
@@ -46,7 +45,7 @@ class CNETBridge extends BridgeAbstract {
if ($limit < 8) {
$article_title = trim($element->find('h2', 0)->plaintext);
- $article_uri = $this->uri.($element->find('a', 0)->href);
+ $article_uri = self::URI.($element->find('a', 0)->href);
$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
$article_author = trim($element->find('a[rel=author]', 0)->plaintext);
diff --git a/bridges/CastorusBridge.php b/bridges/CastorusBridge.php
index 35736b8..2355542 100644
--- a/bridges/CastorusBridge.php
+++ b/bridges/CastorusBridge.php
@@ -1,11 +1,11 @@
array(),
'Get latest changes via ZIP code' => array(
'zip'=>array(
@@ -44,7 +44,7 @@ class CastorusBridge extends BridgeAbstract {
if(!$url)
$this->returnServerError('Cannot find url!');
- return $this->uri . $url->href;
+ return self::URI . $url->href;
}
// Extracts the time from an activity
@@ -77,10 +77,10 @@ class CastorusBridge extends BridgeAbstract {
$zip_filter = trim($this->getInput('zip'));
$city_filter = trim($this->getInput('city'));
- $html = $this->getSimpleHTMLDOM($this->uri);
+ $html = $this->getSimpleHTMLDOM(self::URI);
if(!$html)
- $this->returnServerError('Could not load data from ' . $this->uri . '!');
+ $this->returnServerError('Could not load data from ' . self::URI . '!');
$activities = $html->find('div#activite/li');
diff --git a/bridges/CollegeDeFranceBridge.php b/bridges/CollegeDeFranceBridge.php
index 3d9a21c..a6ae296 100644
--- a/bridges/CollegeDeFranceBridge.php
+++ b/bridges/CollegeDeFranceBridge.php
@@ -1,10 +1,10 @@
*
*/
- $html = $this->getSimpleHTMLDOM($this->uri.'components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all')
+ $html = $this->getSimpleHTMLDOM(self::URI.'components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all')
or $this->returnServerError('Could not request CollegeDeFrance.');
foreach($html->find('a[data-target]') as $element) {
$item = array();
@@ -62,7 +62,7 @@ class CollegeDeFranceBridge extends BridgeAbstract{
}
$item['timestamp'] = $d->format('U');
$item['content'] = $element->find('.lecturer', 0)->innertext . ' - ' . $element->find('.title', 0)->innertext;
- $item['uri'] = $this->uri . $element->href;
+ $item['uri'] = self::URI . $element->href;
$this->items[] = $item;
}
}
diff --git a/bridges/CommonDreamsBridge.php b/bridges/CommonDreamsBridge.php
index 23627e3..446a6df 100644
--- a/bridges/CommonDreamsBridge.php
+++ b/bridges/CommonDreamsBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($url);
diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php
index 6e787db..aa04962 100644
--- a/bridges/CopieDoubleBridge.php
+++ b/bridges/CopieDoubleBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request CopieDouble.');
$table = $html->find('table table', 2);
@@ -26,10 +26,10 @@ class CopieDoubleBridge extends BridgeAbstract{
elseif(strpos($element->innertext, "/images/suivant.gif") === false)
{
$a=$element->find("a", 0);
- $item['uri'] = $this->uri . $a->href;
+ $item['uri'] = self::URI . $a->href;
- $content = str_replace('src="/', 'src="/'.$this->uri,$element->find("td", 0)->innertext);
- $content = str_replace('href="/', 'href="'.$this->uri,$content);
+ $content = str_replace('src="/', 'src="/'.self::URI,$element->find("td", 0)->innertext);
+ $content = str_replace('href="/', 'href="'.self::URI,$content);
$item['content'] = $content;
$this->items[] = $item;
}
diff --git a/bridges/CourrierInternationalBridge.php b/bridges/CourrierInternationalBridge.php
index 09d1aa6..f91916f 100644
--- a/bridges/CourrierInternationalBridge.php
+++ b/bridges/CourrierInternationalBridge.php
@@ -1,14 +1,14 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Error.');
$element = $html->find("article");
@@ -22,7 +22,7 @@ class CourrierInternationalBridge extends BridgeAbstract{
$item['uri'] = $article->parent->getAttribute("href");
if(strpos($item['uri'], "http") === FALSE) {
- $item['uri'] = $this->uri.$item['uri'];
+ $item['uri'] = self::URI.$item['uri'];
}
$page = $this->getSimpleHTMLDOM($item['uri']);
diff --git a/bridges/CpasbienBridge.php b/bridges/CpasbienBridge.php
index c9b7021..454d239 100644
--- a/bridges/CpasbienBridge.php
+++ b/bridges/CpasbienBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Search',
'required'=>true,
@@ -16,7 +16,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
public function collectData(){
$request = str_replace(" ","-",trim($this->getInput('q')));
- $html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($request).'.html')
+ $html = $this->getSimpleHTMLDOM(self::URI.'/recherche/'.urlencode($request).'.html')
or $this->returnServerError('No results for this query.');
foreach ($html->find('#gauche',0)->find('div') as $episode) {
@@ -40,7 +40,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
}
$item['id'] = $episode->find('a', 0)->getAttribute('href');
- $item['uri'] = $this->uri . $htmlepisode->find('#telecharger',0)->getAttribute('href');
+ $item['uri'] = self::URI . $htmlepisode->find('#telecharger',0)->getAttribute('href');
$this->items[] = $item;
}
}
@@ -48,7 +48,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
public function getName(){
- return $this->getInput('q').' : '.$this->name;
+ return $this->getInput('q').' : '.self::NAME;
}
public function getCacheDuration(){
diff --git a/bridges/CryptomeBridge.php b/bridges/CryptomeBridge.php
index a1934b5..e58607a 100644
--- a/bridges/CryptomeBridge.php
+++ b/bridges/CryptomeBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'number of elements',
'type'=>'number',
@@ -16,7 +16,7 @@ class CryptomeBridge extends BridgeAbstract{
));
public function collectData(){
- $html = $this->getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request Cryptome.');
$number=$this->getInput('n');
if (!empty($number)) { /* number of documents */
@@ -27,9 +27,9 @@ class CryptomeBridge extends BridgeAbstract{
foreach($html->find('pre') as $element) {
for ( $i = 0; $i < $num; ++$i ) {
$item = array();
- $item['uri'] = $this->uri.substr($element->find('a', $i)->href, 20);
+ $item['uri'] = self::URI.substr($element->find('a', $i)->href, 20);
$item['title'] = substr($element->find('b', $i)->plaintext, 22);
- $item['content'] = preg_replace('#http://cryptome.org/#', $this->uri, $element->find('b', $i)->innertext);
+ $item['content'] = preg_replace('#http://cryptome.org/#', self::URI, $element->find('b', $i)->innertext);
$this->items[] = $item;
}
break;
diff --git a/bridges/DailymotionBridge.php b/bridges/DailymotionBridge.php
index 7849ba6..8e639fe 100644
--- a/bridges/DailymotionBridge.php
+++ b/bridges/DailymotionBridge.php
@@ -1,12 +1,12 @@
array(
'u'=>array(
'name'=>'username',
@@ -35,7 +35,7 @@ class DailymotionBridge extends BridgeAbstract{
function getMetadata($id) {
$metadata=array();
- $html2 = $this->getSimpleHTMLDOM($this->uri.'video/'.$id);
+ $html2 = $this->getSimpleHTMLDOM(self::URI.'video/'.$id);
if(!$html2){
return $metadata;
}
@@ -90,7 +90,7 @@ class DailymotionBridge extends BridgeAbstract{
}
public function getURI(){
- $uri=$this->uri;
+ $uri=self::URI;
switch($this->queriedContext){
case 'By username':
$uri.='user/'
diff --git a/bridges/DanbooruBridge.php b/bridges/DanbooruBridge.php
index 9f6f63a..3ee8cb6 100644
--- a/bridges/DanbooruBridge.php
+++ b/bridges/DanbooruBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'page',
'type'=>'number'
@@ -18,14 +18,14 @@ class DanbooruBridge extends BridgeAbstract{
$page = $this->getInput('p')?$this->getInput('p'):1;
$tags = urlencode($this->getInput('t'));
- $html = $this->getSimpleHTMLDOM($this->uri."posts?&page=$page&tags=$tags")
+ $html = $this->getSimpleHTMLDOM(self::URI."posts?&page=$page&tags=$tags")
or $this->returnServerError('Could not request Danbooru.');
foreach($html->find('div[id=posts] article') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a', 0)->href;
+ $item['uri'] = self::URI.$element->find('a', 0)->href;
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id'));
$item['timestamp'] = time();
- $thumbnailUri = $this->uri.$element->find('img', 0)->src;
+ $thumbnailUri = self::URI.$element->find('img', 0)->src;
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
$item['title'] = 'Danbooru | '.$item['postid'];
$item['content'] = '
Tags: '.$item['tags'];
diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php
index f94f1ce..30849b4 100644
--- a/bridges/DansTonChatBridge.php
+++ b/bridges/DansTonChatBridge.php
@@ -1,14 +1,14 @@
getSimpleHTMLDOM($this->uri.'latest.html')
+ $html = $this->getSimpleHTMLDOM(self::URI.'latest.html')
or $this->returnServerError('Could not request DansTonChat.');
foreach($html->find('div.item') as $element) {
diff --git a/bridges/DauphineLibereBridge.php b/bridges/DauphineLibereBridge.php
index 09e9809..143a6c0 100644
--- a/bridges/DauphineLibereBridge.php
+++ b/bridges/DauphineLibereBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Catégorie de l\'article',
'type'=>'list',
@@ -41,12 +41,11 @@ class DauphineLibereBridge extends BridgeAbstract {
$context = stream_context_create($opts);
- $category=$this->getInput('u');
- if (empty($category)) {
- $html = $this->getSimpleHTMLDOM($this->uri.$category.'/rss')
+ if (empty($this->getInput('u'))) {
+ $html = $this->getSimpleHTMLDOM(self::URI.$this->getInput('u').'/rss')
or $this->returnServerError('Could not request DauphineLibere.');
} else {
- $html = $this->getSimpleHTMLDOM($this->uri.'rss')
+ $html = $this->getSimpleHTMLDOM(self::URI.'rss')
or $this->returnServerError('Could not request DauphineLibere.');
}
$limit = 0;
diff --git a/bridges/DemoBridge.php b/bridges/DemoBridge.php
index 2fff948..a01d15f 100644
--- a/bridges/DemoBridge.php
+++ b/bridges/DemoBridge.php
@@ -1,12 +1,12 @@
array(
'testCheckbox'=>array(
'type'=>'checkbox',
diff --git a/bridges/DeveloppezDotComBridge.php b/bridges/DeveloppezDotComBridge.php
index a7958e6..48e2974 100644
--- a/bridges/DeveloppezDotComBridge.php
+++ b/bridges/DeveloppezDotComBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'index/rss')
- or $this->returnServerError('Could not request '.$this->uri.'index/rss');
+ $rssFeed = $this->getSimpleHTMLDOM(self::URI.'index/rss')
+ or $this->returnServerError('Could not request '.self::URI.'index/rss');
$limit = 0;
foreach($rssFeed->find('item') as $element) {
diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php
index 05d94fc..ba5a042 100644
--- a/bridges/DilbertBridge.php
+++ b/bridges/DilbertBridge.php
@@ -1,10 +1,10 @@
array(
'name'=>'page',
'type'=>'number'
@@ -18,16 +18,16 @@ class DollbooruBridge extends BridgeAbstract{
public function collectData(){
$page=$this->getInput('p');
$tags = urlencode($this->getInput('t'));
- $html = $this->getSimpleHTMLDOM($this->uri."post/list/$tags/$page")
+ $html = $this->getSimpleHTMLDOM(self::URI."post/list/$tags/$page")
or $this->returnServerError('Could not request Dollbooru.');
foreach($html->find('div[class=shm-image-list] a') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->href;
+ $item['uri'] = self::URI.$element->href;
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id'));
$item['timestamp'] = time();
- $thumbnailUri = $this->uri.$element->find('img', 0)->src;
+ $thumbnailUri = self::URI.$element->find('img', 0)->src;
$item['tags'] = $element->getAttribute('data-tags');
$item['title'] = 'Dollbooru | '.$item['postid'];
$item['content'] = '
Tags: '.$item['tags'];
diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php
index 29719a9..25ec859 100644
--- a/bridges/DuckDuckGoBridge.php
+++ b/bridges/DuckDuckGoBridge.php
@@ -1,19 +1,19 @@
array(
'name'=>'keyword',
'required'=>true)
));
public function collectData(){
- $html = $this->getSimpleHTMLDOM($this->uri.'html/?q='.$this->getInput('u').'+sort:date')
+ $html = $this->getSimpleHTMLDOM(self::URI.'html/?q='.$this->getInput('u').'+sort:date')
or $this->returnServerError('Could not request DuckDuckGo.');
foreach($html->find('div.results_links') as $element) {
diff --git a/bridges/EZTVBridge.php b/bridges/EZTVBridge.php
index a6ab15e..d2399e0 100644
--- a/bridges/EZTVBridge.php
+++ b/bridges/EZTVBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Show ids',
'exampleValue'=>'showID1,showID2,…',
@@ -34,7 +34,7 @@ class EZTVBridge extends BridgeAbstract{
foreach($showList as $showID){
// Get show page
- $html = $this->getSimpleHTMLDOM($this->uri.'shows/'.rawurlencode($showID).'/')
+ $html = $this->getSimpleHTMLDOM(self::URI.'shows/'.rawurlencode($showID).'/')
or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
// Loop on each element that look like an episode entry...
@@ -53,7 +53,7 @@ class EZTVBridge extends BridgeAbstract{
// Fill item
$item = array();
- $item['uri'] = $this->uri.$epinfo->href;
+ $item['uri'] = self::URI.$epinfo->href;
$item['id'] = $item['uri'];
$item['timestamp'] = makeTimestamp($released->plaintext);
$item['title'] = $epinfo->plaintext;
diff --git a/bridges/EliteDangerousGalnetBridge.php b/bridges/EliteDangerousGalnetBridge.php
index a15718a..09d3770 100644
--- a/bridges/EliteDangerousGalnetBridge.php
+++ b/bridges/EliteDangerousGalnetBridge.php
@@ -1,20 +1,20 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Error while downloading the website content');
foreach($html->find('div.article') as $element) {
$item = array();
$uri = $element->find('h3 a', 0)->href;
- $uri = $this->uri . substr($uri,strlen('/galnet/'));
+ $uri = self::URI . substr($uri,strlen('/galnet/'));
$item['uri'] = $uri;
$title = $element->find('h3 a', 0)->plaintext;
diff --git a/bridges/ElsevierBridge.php b/bridges/ElsevierBridge.php
index 0444f63..8905a9e 100644
--- a/bridges/ElsevierBridge.php
+++ b/bridges/ElsevierBridge.php
@@ -1,11 +1,11 @@
array(
'name'=>'Journal name',
'required'=>true,
@@ -56,7 +56,7 @@ class ElsevierBridge extends BridgeAbstract{
}
public function collectData(){
- $uri = $this->uri . $this->getInput('j') . '/recent-articles/';
+ $uri = self::URI . $this->getInput('j') . '/recent-articles/';
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$this->getInput('j'));
foreach($html->find('.pod-listing') as $article){
diff --git a/bridges/EstCeQuonMetEnProdBridge.php b/bridges/EstCeQuonMetEnProdBridge.php
index 531d68b..b4f94b8 100644
--- a/bridges/EstCeQuonMetEnProdBridge.php
+++ b/bridges/EstCeQuonMetEnProdBridge.php
@@ -1,10 +1,10 @@
array(
'name'=>'Username',
'required'=>true
@@ -31,7 +31,7 @@ class FacebookBridge extends BridgeAbstract{
if (is_array($matches) && count($matches) > 1) {
$link = $matches[1];
if (strpos($link, '/') === 0)
- $link = $this->uri.$link.'"';
+ $link = self::URI.$link.'"';
if (strpos($link, 'facebook.com/l.php?u=') !== false)
$link = urldecode(ExtractFromDelimiters($link, 'facebook.com/l.php?u=', '&'));
return ' href="'.$link.'"';
@@ -104,10 +104,10 @@ class FacebookBridge extends BridgeAbstract{
//Retrieve page contents
if (is_null($html)) {
if (!strpos($this->getInput('u'), "/")) {
- $html = $this->getSimpleHTMLDOM($this->uri.urlencode($this->getInput('u')).'?_fb_noscript=1')
+ $html = $this->getSimpleHTMLDOM(self::URI.urlencode($this->getInput('u')).'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
} else {
- $html = $this->getSimpleHTMLDOM($this->uri.'pages/'.$this->getInput('u').'?_fb_noscript=1')
+ $html = $this->getSimpleHTMLDOM(self::URI.'pages/'.$this->getInput('u').'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
}
}
@@ -123,7 +123,7 @@ class FacebookBridge extends BridgeAbstract{
foreach ($captcha->find('input, button') as $input)
$captcha_fields[$input->name] = $input->value;
$_SESSION['captcha_fields'] = $captcha_fields;
- $_SESSION['captcha_action'] = $this->uri.$captcha->find('form', 0)->action;
+ $_SESSION['captcha_action'] = self::URI.$captcha->find('form', 0)->action;
//Show captcha filling form to the viewer, proxying the captcha image
$img = base64_encode($this->getContents($captcha->find('img', 0)->src));
@@ -192,7 +192,7 @@ class FacebookBridge extends BridgeAbstract{
$title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...';
//Build and add final item
- $item['uri'] = $this->uri.$post->find('abbr')[0]->parent()->getAttribute('href');
+ $item['uri'] = self::URI.$post->find('abbr')[0]->parent()->getAttribute('href');
$item['content'] = $content;
$item['title'] = $title;
$item['author'] = $author;
diff --git a/bridges/FierPandaBridge.php b/bridges/FierPandaBridge.php
index 4cdfa8d..5c574fc 100644
--- a/bridges/FierPandaBridge.php
+++ b/bridges/FierPandaBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request Fier Panda.');
+ $html = $this->getSimpleHTMLDOM(self::URI) or $this->returnServerError('Could not request Fier Panda.');
foreach($html->find('div.container-content article') as $element) {
$item = array();
diff --git a/bridges/FlickrExploreBridge.php b/bridges/FlickrExploreBridge.php
index 58343f7..f35333f 100644
--- a/bridges/FlickrExploreBridge.php
+++ b/bridges/FlickrExploreBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri.'explore')
+ $html = $this->getSimpleHTMLDOM(self::URI.'explore')
or $this->returnServerError('Could not request Flickr.');
foreach($html->find('.photo-list-photo-view') as $element) {
@@ -32,7 +32,7 @@ class FlickrExploreBridge extends BridgeAbstract{
)) or $this->returnServerError('Could not request Flickr.'); // FIXME: Request time too long...
$item = array();
- $item['uri'] = $this->uri.'photo.gne?id='.$imageID;
+ $item['uri'] = self::URI.'photo.gne?id='.$imageID;
$item['content'] = '
'; // FIXME: Filter javascript ?
$item['title'] = $imageJSON->photo->title->_content;
$this->items[] = $item;
diff --git a/bridges/FlickrTagBridge.php b/bridges/FlickrTagBridge.php
index 2494567..8b3f1b2 100644
--- a/bridges/FlickrTagBridge.php
+++ b/bridges/FlickrTagBridge.php
@@ -1,12 +1,12 @@
array(
'q'=>array(
'name'=>'keyword',
@@ -25,18 +25,18 @@ class FlickrTagBridge extends BridgeAbstract{
public function collectData(){
switch($this->queriedContext){
case 'By keyword':
- $html = $this->getSimpleHTMLDOM($this->uri.'search/?q='.urlencode($this->getInput('q')).'&s=rec')
+ $html = $this->getSimpleHTMLDOM(self::URI.'search/?q='.urlencode($this->getInput('q')).'&s=rec')
or $this->returnServerError('No results for this query.');
break;
case 'by username':
- $html = $this->getSimpleHTMLDOM($this->uri.'photos/'.urlencode($this->getInput('u')).'/')
+ $html = $this->getSimpleHTMLDOM(self::URI.'photos/'.urlencode($this->getInput('u')).'/')
or $this->returnServerError('Requested username can\'t be found.');
break;
}
foreach($html->find('span.photo_container') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a',0)->href;
+ $item['uri'] = self::URI.$element->find('a',0)->href;
$thumbnailUri = $element->find('img',0)->getAttribute('data-defer-src');
$item['content'] = '
'; // FIXME: Filter javascript ?
$item['title'] = $element->find('a',0)->title;
diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php
index b2c4089..b669ac5 100644
--- a/bridges/FootitoBridge.php
+++ b/bridges/FootitoBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
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 4152a08..f17f38a 100644
--- a/bridges/FourchanBridge.php
+++ b/bridges/FourchanBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Thread URL',
'pattern'=>'(https:\/\/)?boards\.4chan\.org\/.*thread\/.*',
diff --git a/bridges/FreenewsBridge.php b/bridges/FreenewsBridge.php
index 6f98069..60fd34e 100644
--- a/bridges/FreenewsBridge.php
+++ b/bridges/FreenewsBridge.php
@@ -2,10 +2,10 @@
define("FREENEWS_RSS", 'http://feeds.feedburner.com/Freenews-Freebox?format=xml');
class FreenewsBridge extends RssExpander {
- public $maintainer = "mitsukarenai";
- public $name = "Freenews";
- public $uri = "http://freenews.fr";
- public $description = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales.";
+ const MAINTAINER = "mitsukarenai";
+ const NAME = "Freenews";
+ const URI = "http://freenews.fr";
+ const DESCRIPTION = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales.";
public function collectData(){
parent::collectExpandableDatas(FREENEWS_RSS);
diff --git a/bridges/FuturaSciencesBridge.php b/bridges/FuturaSciencesBridge.php
index 3a91467..e4c8471 100644
--- a/bridges/FuturaSciencesBridge.php
+++ b/bridges/FuturaSciencesBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Feed',
'type'=>'list',
diff --git a/bridges/GBAtempBridge.php b/bridges/GBAtempBridge.php
index bab42be..0950dc3 100644
--- a/bridges/GBAtempBridge.php
+++ b/bridges/GBAtempBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Type',
'type'=>'list',
@@ -65,22 +65,22 @@ class GBAtempBridge extends BridgeAbstract {
public function collectData(){
- $html = $this->getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
or $this->returnServerError('Could not request GBAtemp.');
switch($this->getInput('type')){
case 'N':
foreach ($html->find('li[class=news_item full]') as $newsItem) {
- $url = $this->uri.$newsItem->find('a', 0)->href;
+ $url = self::URI.$newsItem->find('a', 0)->href;
$time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $newsItem->find('a.username', 0)->plaintext;
$title = $newsItem->find('a', 1)->plaintext;
- $content = $this->fetch_post_content($url, $this->uri);
+ $content = $this->fetch_post_content($url, self::URI);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
case 'R':
foreach ($html->find('li.portal_review') as $reviewItem) {
- $url = $this->uri.$reviewItem->find('a', 0)->href;
+ $url = self::URI.$reviewItem->find('a', 0)->href;
$title = $reviewItem->find('span.review_title', 0)->plaintext;
$content = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request GBAtemp: '.$uri);
$author = $content->find('a.username', 0)->plaintext;
@@ -90,25 +90,25 @@ class GBAtempBridge extends BridgeAbstract {
$subheader = '
'.$content->find('div.review_subheader', 0)->plaintext.'
';
$procons = $content->find('table.review_procons', 0)->outertext;
$scores = $content->find('table.reviewscores', 0)->outertext;
- $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->uri);
+ $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, self::URI);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
case 'T':
foreach ($html->find('li.portal-tutorial') as $tutorialItem) {
- $url = $this->uri.$tutorialItem->find('a', 0)->href;
+ $url = self::URI.$tutorialItem->find('a', 0)->href;
$title = $tutorialItem->find('a', 0)->plaintext;
$time = intval($this->ExtractFromDelimiters($tutorialItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $tutorialItem->find('a.username', 0)->plaintext;
- $content = $this->fetch_post_content($url, $this->uri);
+ $content = $this->fetch_post_content($url, self::URI);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
case 'F':
foreach ($html->find('li.rc_item') as $postItem) {
- $url = $this->uri.$postItem->find('a', 1)->href;
+ $url = self::URI.$postItem->find('a', 1)->href;
$title = $postItem->find('a', 1)->plaintext;
$time = intval($this->ExtractFromDelimiters($postItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $postItem->find('a.username', 0)->plaintext;
- $content = $this->fetch_post_content($url, $this->uri);
+ $content = $this->fetch_post_content($url, self::URI);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
}
@@ -117,7 +117,7 @@ class GBAtempBridge extends BridgeAbstract {
public function getName() {
$type=array_search(
$this->getInput('type'),
- $this->parameters[$this->queriedContext]['type']['values']
+ self::PARAMETERS[$this->queriedContext]['type']['values']
);
return 'GBAtemp '.$type.' Bridge';
}
diff --git a/bridges/GelbooruBridge.php b/bridges/GelbooruBridge.php
index 811a905..f612c98 100644
--- a/bridges/GelbooruBridge.php
+++ b/bridges/GelbooruBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'page',
'type'=>'number'
@@ -16,14 +16,14 @@ class GelbooruBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(
- $this->uri.'index.php?page=post&s=list&'
+ self::URI.'index.php?page=post&s=list&'
.'&pid='.($this->getInput('p')?($this->getInput('p') -1)*63:'')
.'&tags='.urlencode($this->getInput('t'))
) or $this->returnServerError('Could not request Gelbooru.');
foreach($html->find('div[class=content] span') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a', 0)->href;
+ $item['uri'] = self::URI.$element->find('a', 0)->href;
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item['timestamp'] = time();
$thumbnailUri = $element->find('img', 0)->src;
diff --git a/bridges/GiphyBridge.php b/bridges/GiphyBridge.php
index 95beea5..dcdff8b 100644
--- a/bridges/GiphyBridge.php
+++ b/bridges/GiphyBridge.php
@@ -3,12 +3,12 @@ define('GIPHY_LIMIT', 10);
class GiphyBridge extends BridgeAbstract{
- public $maintainer = "kraoc";
- public $name = "Giphy Bridge";
- public $uri = "http://giphy.com/";
- public $description = "Bridge for giphy.com";
+ const MAINTAINER = "kraoc";
+ const NAME = "Giphy Bridge";
+ const URI = "http://giphy.com/";
+ const DESCRIPTION = "Bridge for giphy.com";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
's'=>array(
'name'=>'search tag',
'required'=>true
@@ -22,7 +22,7 @@ class GiphyBridge extends BridgeAbstract{
public function collectData(){
$html = '';
$base_url = 'http://giphy.com';
- $html = $this->getSimpleHTMLDOM($this->uri.'/search/'.urlencode($this->getInput('s').'/'))
+ $html = $this->getSimpleHTMLDOM(self::URI.'/search/'.urlencode($this->getInput('s').'/'))
or $this->returnServerError('No results for this query.');
$max = GIPHY_LIMIT;
@@ -37,7 +37,7 @@ class GiphyBridge extends BridgeAbstract{
$node = $entry->first_child();
$href = $node->getAttribute('href');
- $html2 = $this->getSimpleHTMLDOM($this->uri . $href)
+ $html2 = $this->getSimpleHTMLDOM(self::URI . $href)
or $this->returnServerError('No results for this query.');
$figure = $html2->getElementByTagName('figure');
$img = $figure->firstChild();
diff --git a/bridges/GithubIssueBridge.php b/bridges/GithubIssueBridge.php
index 480a244..767d584 100644
--- a/bridges/GithubIssueBridge.php
+++ b/bridges/GithubIssueBridge.php
@@ -1,12 +1,12 @@
array (
'u'=>array(
'name'=>'User name',
@@ -29,7 +29,7 @@ class GithubIssueBridge extends BridgeAbstract{
);
public function collectData(){
- $uri = $this->uri.$this->getInput('u').'/'.$this->getInput('p')
+ $uri = self::URI.$this->getInput('u').'/'.$this->getInput('p')
.'/issues/'.$this->getInput('i');
$html = $this->getSimpleHTMLDOM($uri)
or $this->returnServerError('No results for Github Issue '.$this->getInput('i').' in project '.$this->getInput('u').'/'.$this->getInput('p'));
@@ -60,7 +60,7 @@ class GithubIssueBridge extends BridgeAbstract{
$item['title']=$issue->find('.js-navigation-open',0)->plaintext;
$comments=$issue->find('.col-5',0)->plaintext;
$item['content']='Comments: '.($comments?$comments:'0');
- $item['uri']=$this->uri.$issue->find('.js-navigation-open',0)->getAttribute('href');
+ $item['uri']=self::URI.$issue->find('.js-navigation-open',0)->getAttribute('href');
$this->items[]=$item;
}
break;
diff --git a/bridges/GitlabCommitsBridge.php b/bridges/GitlabCommitsBridge.php
index f5fe97e..8c7ec71 100644
--- a/bridges/GitlabCommitsBridge.php
+++ b/bridges/GitlabCommitsBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'Base URI',
'defaultValue'=>'https://gitlab.com'
diff --git a/bridges/GizmodoFRBridge.php b/bridges/GizmodoFRBridge.php
index 660da8a..e653130 100644
--- a/bridges/GizmodoFRBridge.php
+++ b/bridges/GizmodoFRBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'/feed')
- or $this->returnServerError('Could not request '.$this->uri.'/feed');
+ $rssFeed = $this->getSimpleHTMLDOM(self::URI.'/feed')
+ or $this->returnServerError('Could not request '.self::URI.'/feed');
$limit = 0;
foreach($rssFeed->find('item') as $element) {
diff --git a/bridges/GooglePlusPostBridge.php b/bridges/GooglePlusPostBridge.php
index a55620f..b86151d 100644
--- a/bridges/GooglePlusPostBridge.php
+++ b/bridges/GooglePlusPostBridge.php
@@ -4,12 +4,12 @@ class GooglePlusPostBridge extends BridgeAbstract
protected $_title;
protected $_url;
- public $maintainer = "Grummfy";
- public $name = "Google Plus Post Bridge";
- public $uri = "https://plus.google.com/";
- public $description = "Returns user public post (without API).";
+ const MAINTAINER = "Grummfy";
+ const NAME = "Google Plus Post Bridge";
+ const URI = "https://plus.google.com/";
+ const DESCRIPTION = "Returns user public post (without API).";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'username'=>array(
'name'=>'username or Id',
'required'=>true
@@ -20,7 +20,7 @@ class GooglePlusPostBridge extends BridgeAbstract
{
// get content parsed
// $html = $this->getSimpleHTMLDOM(__DIR__ . '/../posts2.html'
- $html = $this->getSimpleHTMLDOM($this->uri . urlencode($this->getInput('username')) . '/posts'
+ $html = $this->getSimpleHTMLDOM(self::URI . urlencode($this->getInput('username')) . '/posts'
// force language
, false, stream_context_create(array('http'=> array(
'header' => 'Accept-Language: fr,fr-be,fr-fr;q=0.8,en;q=0.4,en-us;q=0.2;*' . "\r\n"
@@ -48,7 +48,7 @@ class GooglePlusPostBridge extends BridgeAbstract
// $item['title'] = $item['fullname'] = $post->find('header.lea', 0)->plaintext;
$item['avatar'] = $post->find('div.ys img', 0)->src;
// var_dump((($post->find('a.o-U-s', 0)->getAllAttributes())));
- $item['uri'] = $this->uri . $post->find('a.o-U-s', 0)->href;
+ $item['uri'] = self::URI . $post->find('a.o-U-s', 0)->href;
$item['timestamp'] = strtotime($post->find('a.o-U-s', 0)->plaintext);
$this->items[] = $item;
@@ -56,21 +56,21 @@ class GooglePlusPostBridge extends BridgeAbstract
$hashtags = array();
foreach($post->find('a.d-s') as $hashtag)
{
- $hashtags[ trim($hashtag->plaintext) ] = $this->uri . $hashtag->href;
+ $hashtags[ trim($hashtag->plaintext) ] = self::URI . $hashtag->href;
}
$item['content'] = '';
// avatar display
- $item['content'] .= '
';
$content = $post->find('div.Al', 0);
// alter link
// $content = $content->innertext;
-// $content = str_replace('href="./', 'href="' . $this->uri, $content);
-// $content = str_replace('href="photos', 'href="' . $this->uri . 'photos', $content);
+// $content = str_replace('href="./', 'href="' . self::URI, $content);
+// $content = str_replace('href="photos', 'href="' . self::URI . 'photos', $content);
// XXX ugly but I don't have any idea how to do a better stuff, str_replace on link doesn't work as expected and ask too many checks
foreach($content->find('a') as $link)
{
@@ -86,7 +86,7 @@ class GooglePlusPostBridge extends BridgeAbstract
{
$link->href = substr($link->href, 1);
}
- $link->href = $this->uri . $link->href;
+ $link->href = self::URI . $link->href;
}
}
$content = $content->innertext;
@@ -107,7 +107,7 @@ class GooglePlusPostBridge extends BridgeAbstract
public function getURI()
{
- return $this->_url ?: $this->uri;
+ return $this->_url ?: self::URI;
}
public function getCacheDuration()
diff --git a/bridges/GoogleSearchBridge.php b/bridges/GoogleSearchBridge.php
index fb3d740..9c3724f 100644
--- a/bridges/GoogleSearchBridge.php
+++ b/bridges/GoogleSearchBridge.php
@@ -9,12 +9,12 @@
*/
class GoogleSearchBridge extends BridgeAbstract{
- public $maintainer = "sebsauvage";
- public $name = "Google search";
- public $uri = "https://www.google.com/";
- public $description = "Returns most recent results from Google search.";
+ const MAINTAINER = "sebsauvage";
+ const NAME = "Google search";
+ const URI = "https://www.google.com/";
+ const DESCRIPTION = "Returns most recent results from Google search.";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'q'=>array(
'name'=>"keyword",
'required'=>true
@@ -25,7 +25,7 @@ class GoogleSearchBridge extends BridgeAbstract{
public function collectData(){
$html = '';
- $html = $this->getSimpleHTMLDOM($this->uri
+ $html = $this->getSimpleHTMLDOM(self::URI
.'search?q=' . urlencode($this->getInput('q'))
.'&num=100&complete=0&tbs=qdr:y,sbd:1')
or $this->returnServerError('No results for this query.');
diff --git a/bridges/GuruMedBridge.php b/bridges/GuruMedBridge.php
index 297dc56..0c4bf2c 100644
--- a/bridges/GuruMedBridge.php
+++ b/bridges/GuruMedBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'feed')
+ $html = $this->getSimpleHTMLDOM(self::URI.'feed')
or $this->returnServerError('Could not request Gurumed.');
$limit = 0;
diff --git a/bridges/HDWallpapersBridge.php b/bridges/HDWallpapersBridge.php
index fde1aaa..bfa4979 100644
--- a/bridges/HDWallpapersBridge.php
+++ b/bridges/HDWallpapersBridge.php
@@ -1,11 +1,11 @@
array(
'name'=>'category',
'defaultValue'=>'latest_wallpapers'
@@ -29,7 +29,7 @@ class HDWallpapersBridge extends BridgeAbstract {
$lastpage = 1;
for ($page = 1; $page <= $lastpage; $page++) {
- $link = $this->uri.'/'.$category.'/page/'.$page;
+ $link = self::URI.'/'.$category.'/page/'.$page;
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('No results for this query.');
if ($page === 1) {
@@ -42,10 +42,10 @@ class HDWallpapersBridge extends BridgeAbstract {
$item = array();
// http://www.hdwallpapers.in/download/yosemite_reflections-1680x1050.jpg
- $item['uri'] = $this->uri.'/download'.str_replace('wallpapers.html', $this->getInput('r').'.jpg', $element->href);
+ $item['uri'] = self::URI.'/download'.str_replace('wallpapers.html', $this->getInput('r').'.jpg', $element->href);
$item['timestamp'] = time();
$item['title'] = $element->find('p', 0)->text();
- $item['content'] = $item['title'].'
';
+ $item['content'] = $item['title'].'
';
$this->items[] = $item;
$num++;
diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php
index e970d00..2732560 100644
--- a/bridges/HentaiHavenBridge.php
+++ b/bridges/HentaiHavenBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
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 f99bde7..200634e 100644
--- a/bridges/IdenticaBridge.php
+++ b/bridges/IdenticaBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'username',
'required'=>true
@@ -32,7 +32,7 @@ class IdenticaBridge extends BridgeAbstract{
}
public function getURI(){
- return $this->uri.urlencode($this->getInput('u'));
+ return self::URI.urlencode($this->getInput('u'));
}
public function getCacheDuration(){
diff --git a/bridges/InstagramBridge.php b/bridges/InstagramBridge.php
index bec19b2..6105603 100644
--- a/bridges/InstagramBridge.php
+++ b/bridges/InstagramBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'username',
'required'=>true
@@ -46,7 +46,7 @@ class InstagramBridge extends BridgeAbstract{
{
$item = array();
- $item['uri'] = $this->uri.'/p/'.$media->code.'/';
+ $item['uri'] = self::URI.'/p/'.$media->code.'/';
$item['content'] = '
';
if (isset($media->caption))
{
@@ -65,7 +65,7 @@ class InstagramBridge extends BridgeAbstract{
}
public function getURI(){
- return $this->uri.urlencode($this->getInput('u'));
+ return self::URI.urlencode($this->getInput('u'));
}
}
diff --git a/bridges/IsoHuntBridge.php b/bridges/IsoHuntBridge.php
index f99ceef..4c4b268 100644
--- a/bridges/IsoHuntBridge.php
+++ b/bridges/IsoHuntBridge.php
@@ -1,11 +1,11 @@
uri;
+ $uri=self::URI;
switch($this->queriedContext){
case 'By "Latest" category':
switch($this->getInput('latest_category')){
@@ -132,27 +132,27 @@ class IsoHuntBridge extends BridgeAbstract{
$categoryName =
array_search(
$this->getInput('latest_category'),
- $this->parameters['By "Latest" category']['latest_category']['values']
+ self::PARAMETERS['By "Latest" category']['latest_category']['values']
);
- $name = 'Latest '.$categoryName.' - ' . $this->name;
+ $name = 'Latest '.$categoryName.' - ' . self::NAME;
break;
case 'By "Torrent" category':
$categoryName =
array_search(
$this->getInput('torrent_category'),
- $this->parameters['By "Torrent" category']['torrent_category']['values']
+ self::PARAMETERS['By "Torrent" category']['torrent_category']['values']
);
- $name = 'Category: ' . $categoryName . ' - ' . $this->name;
+ $name = 'Category: ' . $categoryName . ' - ' . self::NAME;
break;
case 'Search torrent by name':
$categoryName =
array_search(
$this->getInput('search_category'),
- $this->parameters['Search torrent by name']['search_category']['values']
+ self::PARAMETERS['Search torrent by name']['search_category']['values']
);
- $name = 'Search: "' . $this->getInput('search_name') . '" in category: ' . $categoryName . ' - ' . $this->name;
+ $name = 'Search: "' . $this->getInput('search_name') . '" in category: ' . $categoryName . ' - ' . self::NAME;
break;
}
@@ -446,7 +446,7 @@ class IsoHuntBridge extends BridgeAbstract{
}
private function fix_relative_uri($uri){
- return preg_replace('/\//i', $this->uri, $uri, 1);
+ return preg_replace('/\//i', self::URI, $uri, 1);
}
private function build_category_uri($category, $order_popularity = false){
diff --git a/bridges/JapanExpoBridge.php b/bridges/JapanExpoBridge.php
index b02304a..db8a202 100644
--- a/bridges/JapanExpoBridge.php
+++ b/bridges/JapanExpoBridge.php
@@ -1,11 +1,11 @@
array(
'name'=>'Show full contents',
'type'=>'checkbox',
@@ -42,8 +42,8 @@ class JapanExpoBridge extends HttpCachingBridgeAbstract {
}
};
- $html = $this->getSimpleHTMLDOM($this->uri)
- or $this->returnServerError('Could not request JapanExpo: '.$this->uri);
+ $html = $this->getSimpleHTMLDOM(self::URI)
+ or $this->returnServerError('Could not request JapanExpo: '.self::URI);
$fullcontent = $this->getInput('mode');
$count = 0;
diff --git a/bridges/KonachanBridge.php b/bridges/KonachanBridge.php
index 50730dc..0a213fe 100644
--- a/bridges/KonachanBridge.php
+++ b/bridges/KonachanBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'page',
'defaultValue'=>1,
@@ -17,7 +17,7 @@ class KonachanBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(
- $this->uri.'/post?'
+ self::URI.'/post?'
.'&page='.$this->getInput('p')
.'&tags='.urlencode($this->getInput('t'))
) or $this->returnServerError('Could not request Konachan.');
@@ -30,7 +30,7 @@ class KonachanBridge extends BridgeAbstract{
foreach($data as $datai) {
$json = json_decode($datai, TRUE);
$item = array();
- $item['uri'] = $this->uri.'/post/show/'.$json['id'];
+ $item['uri'] = self::URI.'/post/show/'.$json['id'];
$item['postid'] = $json['id'];
$item['timestamp'] = $json['created_at'];
$item['imageUri'] = $json['file_url'];
diff --git a/bridges/KoreusBridge.php b/bridges/KoreusBridge.php
index 4cb86c8..f079bca 100644
--- a/bridges/KoreusBridge.php
+++ b/bridges/KoreusBridge.php
@@ -1,10 +1,10 @@
array(
'site'=>array(
'name'=>'Site',
@@ -55,12 +55,12 @@ class KununuBridge extends HttpCachingBridgeAbstract {
break;
}
- return $this->uri.$site.'/'.$company.'/'.$section;
+ return self::URI.$site.'/'.$company.'/'.$section;
}
function getName(){
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
- return ($this->companyName?:$company).' - '.$this->name;
+ return ($this->companyName?:$company).' - '.self::NAME;
}
public function collectData(){
@@ -109,7 +109,7 @@ class KununuBridge extends HttpCachingBridgeAbstract {
* Fixes relative URLs in the given text
*/
private function fix_url($text){
- return preg_replace('/href=(\'|\")\//i', 'href="'.$this->uri, $text);
+ return preg_replace('/href=(\'|\")\//i', 'href="'.self::URI, $text);
}
/**
@@ -184,7 +184,7 @@ class KununuBridge extends HttpCachingBridgeAbstract {
if($anchor === false)
$this->returnServerError('Cannot find article URI!');
- return $this->uri . $anchor->href;
+ return self::URI . $anchor->href;
}
/**
diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php
index c267362..704c1d5 100644
--- a/bridges/LWNprevBridge.php
+++ b/bridges/LWNprevBridge.php
@@ -1,12 +1,12 @@
uri.'free/bigpage';
+ return self::URI.'free/bigpage';
}
private function jumpToNextTag(&$node){
@@ -48,7 +48,7 @@ class LWNprevBridge extends BridgeAbstract{
break;
}
}
- $realURI=$this->uri.$a->getAttribute('href');
+ $realURI=self::URI.$a->getAttribute('href');
$URICounter=0;
$edition=$html->getElementsByTagName('h1')->item(0)->textContent;
@@ -82,7 +82,7 @@ class LWNprevBridge extends BridgeAbstract{
$h2FirstChild=$h2->firstChild;
$this->jumpToNextTag($h2FirstChild);
if($h2FirstChild->nodeName==='a'){
- $item['uri']=$this->uri.$h2FirstChild->getAttribute('href');
+ $item['uri']=self::URI.$h2FirstChild->getAttribute('href');
}else{
$item['uri']=$realURI.'#'.$URICounter;
}
diff --git a/bridges/LeBonCoinBridge.php b/bridges/LeBonCoinBridge.php
index fab1a71..6b89f46 100755
--- a/bridges/LeBonCoinBridge.php
+++ b/bridges/LeBonCoinBridge.php
@@ -1,12 +1,12 @@
array('name'=>'Mot Clé'),
'r'=>array(
'name'=>'Région',
@@ -143,7 +143,7 @@ class LeBonCoinBridge extends BridgeAbstract{
}
$html = $this->getSimpleHTMLDOM(
- $this->uri.$category.'/offres/' . $this->getInput('r') . '/?'
+ self::URI.$category.'/offres/' . $this->getInput('r') . '/?'
.'f=a&th=1&'
.'q=' . urlencode($this->getInput('k'))
) or $this->returnServerError('Could not request LeBonCoin.');
diff --git a/bridges/LeJournalDuGeekBridge.php b/bridges/LeJournalDuGeekBridge.php
index f1b89a1..e08f419 100644
--- a/bridges/LeJournalDuGeekBridge.php
+++ b/bridges/LeJournalDuGeekBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'rss')
- or $this->returnServerError('Could not request '.$this->uri.'/rss');
+ $rssFeed = $this->getSimpleHTMLDOM(self::URI.'rss')
+ or $this->returnServerError('Could not request '.self::URI.'/rss');
$limit = 0;
foreach($rssFeed->find('item') as $element) {
diff --git a/bridges/LeMondeInformatiqueBridge.php b/bridges/LeMondeInformatiqueBridge.php
index b744e76..8fd1daa 100644
--- a/bridges/LeMondeInformatiqueBridge.php
+++ b/bridges/LeMondeInformatiqueBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'rss/rss.xml')
+ $html = $this->getSimpleHTMLDOM(self::URI.'rss/rss.xml')
or $this->returnServerError('Could not request LeMondeInformatique: '
- .$this->uri.'rss/rss.xml');
+ .self::URI.'rss/rss.xml');
$limit = 0;
foreach($html->find('item') as $element) {
diff --git a/bridges/Les400CulsBridge.php b/bridges/Les400CulsBridge.php
index 3fea2ff..ce56537 100644
--- a/bridges/Les400CulsBridge.php
+++ b/bridges/Les400CulsBridge.php
@@ -1,14 +1,14 @@
collectExpandableDatas($this->uri.'feeds/');
+ $this->collectExpandableDatas(self::URI.'feeds/');
}
protected function parseRSSItem($newsItem) {
diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php
index 1d83556..81023b1 100644
--- a/bridges/LesJoiesDuCodeBridge.php
+++ b/bridges/LesJoiesDuCodeBridge.php
@@ -1,13 +1,13 @@
getSimpleHTMLDOM($this->uri)
+ $html = $this->getSimpleHTMLDOM(self::URI)
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 4e81e9c..f74c2bd 100644
--- a/bridges/LichessBridge.php
+++ b/bridges/LichessBridge.php
@@ -2,14 +2,14 @@
class LichessBridge extends HttpCachingBridgeAbstract
{
- public $maintainer = 'AmauryCarrade';
- public $name = 'Lichess Blog';
- public $uri = 'http://fr.lichess.org/blog';
- public $description = 'Returns the 5 newest posts from the Lichess blog (full text)';
+ const MAINTAINER = 'AmauryCarrade';
+ const NAME = 'Lichess Blog';
+ const URI = 'http://fr.lichess.org/blog';
+ const DESCRIPTION = 'Returns the 5 newest posts from the Lichess blog (full text)';
public function collectData()
{
- $xml_feed = $this->getSimpleHTMLDOM($this->uri.'.atom')
+ $xml_feed = $this->getSimpleHTMLDOM(self::URI.'.atom')
or $this->returnServerError('Could not retrieve Lichess blog feed.');
$posts_loaded = 0;
diff --git a/bridges/LinkedInCompanyBridge.php b/bridges/LinkedInCompanyBridge.php
index e23f9d4..6ccbba5 100644
--- a/bridges/LinkedInCompanyBridge.php
+++ b/bridges/LinkedInCompanyBridge.php
@@ -1,12 +1,12 @@
apple)";
+ const MAINTAINER = "regisenguehard";
+ const NAME = "LinkedIn Company";
+ const URI = "https://www.linkedin.com/";
+ const DESCRIPTION = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/
apple)";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'c'=>array(
'name'=>'Company name',
'required'=>true
@@ -15,7 +15,7 @@ class LinkedInCompanyBridge extends BridgeAbstract{
public function collectData(){
$html = '';
- $link = $this->uri.'company/'.$this->getInput('c');
+ $link = self::URI.'company/'.$this->getInput('c');
$html = $this->getSimpleHTMLDOM($link)
or $this->returnServerError('Could not request LinkedIn.');
diff --git a/bridges/LolibooruBridge.php b/bridges/LolibooruBridge.php
index 1bcf037..d2f9066 100644
--- a/bridges/LolibooruBridge.php
+++ b/bridges/LolibooruBridge.php
@@ -1,12 +1,12 @@
array(
'name'=>'page',
'defaultValue'=>1,
@@ -17,7 +17,7 @@ class LolibooruBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(
- $this->uri.'post?'
+ self::URI.'post?'
.'&page='.$this->getInput('p')
.'&tags='.urlencode($this->getInput('t'))
) or $this->returnServerError('Could not request Lolibooru.');
@@ -30,7 +30,7 @@ class LolibooruBridge extends BridgeAbstract{
foreach($data as $datai) {
$json = json_decode($datai, TRUE);
$item = array();
- $item['uri'] = $this->uri.'post/show/'.$json['id'];
+ $item['uri'] = self::URI.'post/show/'.$json['id'];
$item['postid'] = $json['id'];
$item['timestamp'] = $json['created_at'];
$item['imageUri'] = $json['file_url'];
diff --git a/bridges/MangareaderBridge.php b/bridges/MangareaderBridge.php
index cdf5a70..ce93ed3 100644
--- a/bridges/MangareaderBridge.php
+++ b/bridges/MangareaderBridge.php
@@ -2,12 +2,12 @@
define('MANGAREADER_LIMIT', 10); // The default limit
class MangareaderBridge extends BridgeAbstract{
- public $maintainer = "logmanoriginal";
- public $name = "Mangareader Bridge";
- public $uri = "http://www.mangareader.net/";
- public $description = "Returns the latest updates, popular mangas or manga updates (new chapters)";
+ const MAINTAINER = "logmanoriginal";
+ const NAME = "Mangareader Bridge";
+ const URI = "http://www.mangareader.net/";
+ const DESCRIPTION = "Returns the latest updates, popular mangas or manga updates (new chapters)";
- public $parameters = array(
+ const PARAMETERS = array(
'Get latest updates' => array(),
'Get popular mangas' => array(
'category'=>array(
@@ -108,7 +108,7 @@ class MangareaderBridge extends BridgeAbstract{
if (isset($manga) && $chapters->length >= 1){
$item = array();
- $item['uri'] = $this->uri. htmlspecialchars($manga->getAttribute('href'));
+ $item['uri'] = self::URI. htmlspecialchars($manga->getAttribute('href'));
$item['title'] = htmlspecialchars($manga->nodeValue);
// Add each chapter to the feed
@@ -118,7 +118,7 @@ class MangareaderBridge extends BridgeAbstract{
if($item['content'] <> ""){
$item['content'] .= "
";
}
- $item['content'] .= "
" . htmlspecialchars($chapter->nodeValue) . "";
+ $item['content'] .= "
" . htmlspecialchars($chapter->nodeValue) . "";
}
$this->items[] = $item;
@@ -142,7 +142,7 @@ class MangareaderBridge extends BridgeAbstract{
$item = array();
$item['title'] = htmlspecialchars($xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->nodeValue);
- $item['uri'] = $this->uri . $xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->getAttribute('href');
+ $item['uri'] = self::URI . $xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->getAttribute('href');
$item['author'] = htmlspecialchars($xpath->query("//*[@class='author_name']", $manga)->item(0)->nodeValue);
$item['chaptercount'] = $xpath->query(".//*[@class='chapter_count']", $manga)->item(0)->nodeValue;
$item['genre'] = htmlspecialchars($xpath->query(".//*[@class='manga_genre']", $manga)->item(0)->nodeValue);
@@ -170,7 +170,7 @@ class MangareaderBridge extends BridgeAbstract{
foreach ($chapters as $chapter){
$item = array();
$item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue);
- $item['uri'] = $this->uri . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href');
+ $item['uri'] = self::URI . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href');
$item['timestamp'] = strtotime($xpath->query("td[2]", $chapter)->item(0)->nodeValue);
array_unshift($this->items, $item);
}
@@ -201,7 +201,7 @@ class MangareaderBridge extends BridgeAbstract{
$path = $this->getInput('path');
break;
}
- return $this->uri . $path;
+ return self::URI . $path;
}
diff --git a/bridges/MilbooruBridge.php b/bridges/MilbooruBridge.php
index 1dc08cf..43799df 100644
--- a/bridges/MilbooruBridge.php
+++ b/bridges/MilbooruBridge.php
@@ -2,12 +2,12 @@
class MilbooruBridge extends BridgeAbstract{
- public $maintainer = "mitsukarenai";
- public $name = "Milbooru";
- public $uri = "http://sheslostcontrol.net/moe/shimmie/";
- public $description = "Returns images from given page";
+ const MAINTAINER = "mitsukarenai";
+ const NAME = "Milbooru";
+ const URI = "http://sheslostcontrol.net/moe/shimmie/";
+ const DESCRIPTION = "Returns images from given page";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
@@ -17,15 +17,15 @@ class MilbooruBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(
- $this->uri.'?q=/post/list/'.urlencode($this->getInput('t')).'/'.$this->getInput('p')
+ self::URI.'?q=/post/list/'.urlencode($this->getInput('t')).'/'.$this->getInput('p')
)or $this->returnServerError('Could not request Milbooru.');
foreach($html->find('div[class=shm-image-list] span[class=thumb]') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a', 0)->href;
+ $item['uri'] = self::URI.$element->find('a', 0)->href;
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->find('a', 0)->getAttribute('data-post-id'));
$item['timestamp'] = time();
- $thumbnailUri = $this->uri.$element->find('img', 0)->src;
+ $thumbnailUri = self::URI.$element->find('img', 0)->src;
$item['tags'] = $element->find('a', 0)->getAttribute('data-tags');
$item['title'] = 'Milbooru | '.$item['postid'];
$item['content'] = '
Tags: '.$item['tags'];
diff --git a/bridges/MondeDiploBridge.php b/bridges/MondeDiploBridge.php
index 2a6afc4..c9d20af 100644
--- a/bridges/MondeDiploBridge.php
+++ b/bridges/MondeDiploBridge.php
@@ -1,19 +1,19 @@
getSimpleHTMLDOM($this->uri)
- or $this->returnServerError('Could not request MondeDiplo. for : ' . $this->uri);
+ $html = $this->getSimpleHTMLDOM(self::URI)
+ or $this->returnServerError('Could not request MondeDiplo. for : ' . self::URI);
foreach($html->find('div.unarticle') as $article) {
$element = $article->parent();
$item = array();
- $item['uri'] = $this->uri . $element->href;
+ $item['uri'] = self::URI . $element->href;
$item['title'] = $element->find('h3', 0)->plaintext;
$item['content'] = $element->find('div.dates_auteurs', 0)->plaintext . '
' . strstr($element->find('div', 0)->plaintext, $element->find('div.dates_auteurs', 0)->plaintext, true);
$this->items[] = $item;
diff --git a/bridges/MsnMondeBridge.php b/bridges/MsnMondeBridge.php
index 5e48195..f7b4c77 100644
--- a/bridges/MsnMondeBridge.php
+++ b/bridges/MsnMondeBridge.php
@@ -1,13 +1,13 @@
uri.'fr-fr/actualite/monde';
+ return self::URI.'fr-fr/actualite/monde';
}
private function MsnMondeExtractContent($url, &$item) {
@@ -23,7 +23,7 @@ class MsnMondeBridge extends BridgeAbstract{
if($limit < 10) {
$item = array();
$item['title'] = utf8_decode($article->find('h4', 0)->innertext);
- $item['uri'] = $this->uri . utf8_decode($article->find('a', 0)->href);
+ $item['uri'] = self::URI . utf8_decode($article->find('a', 0)->href);
$this->MsnMondeExtractContent($item['uri'], $item);
$this->items[] = $item;
$limit++;
diff --git a/bridges/MspabooruBridge.php b/bridges/MspabooruBridge.php
index e255f9e..821207e 100644
--- a/bridges/MspabooruBridge.php
+++ b/bridges/MspabooruBridge.php
@@ -2,12 +2,12 @@
class MspabooruBridge extends BridgeAbstract{
- public $maintainer = "mitsukarenai";
- public $name = "Mspabooru";
- public $uri = "http://mspabooru.com/";
- public $description = "Returns images from given page";
+ const MAINTAINER = "mitsukarenai";
+ const NAME = "Mspabooru";
+ const URI = "http://mspabooru.com/";
+ const DESCRIPTION = "Returns images from given page";
- public $parameters = array( array(
+ const PARAMETERS = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
@@ -17,7 +17,7 @@ class MspabooruBridge extends BridgeAbstract{
public function collectData(){
$html = $this->getSimpleHTMLDOM(
- $this->uri.'index.php?page=post&s=list&'
+ self::URI.'index.php?page=post&s=list&'
.'&pid='.($this->getInput('p')?($this->getInput('p') -1)*50:'')
.'&tags='.urlencode($this->getInput('t'))
) or $this->returnServerError('Could not request Mspabooru.');
@@ -25,7 +25,7 @@ class MspabooruBridge extends BridgeAbstract{
foreach($html->find('div[class=content] span') as $element) {
$item = array();
- $item['uri'] = $this->uri.$element->find('a', 0)->href;
+ $item['uri'] = self::URI.$element->find('a', 0)->href;
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item['timestamp'] = time();
$thumbnailUri = $element->find('img', 0)->src;
diff --git a/bridges/NakedSecurityBridge.php b/bridges/NakedSecurityBridge.php
index 5d0fb36..893bc87 100644
--- a/bridges/NakedSecurityBridge.php
+++ b/bridges/NakedSecurityBridge.php
@@ -1,10 +1,10 @@
getSimpleHTMLDOM($this->uri.'archivepix.html') or $this->returnServerError('Error while downloading the website content');
+ $html = $this->getSimpleHTMLDOM(self::URI.'archivepix.html') or $this->returnServerError('Error while downloading the website content');
$list = explode("
", $html->find('b', 0)->innertext);
for($i = 0; $i < 3;$i++)
@@ -17,7 +17,7 @@ class NasaApodBridge extends BridgeAbstract{
$item = array();
$uri_page = $html->find('a',$i + 3)->href;
- $uri = $this->uri.$uri_page;
+ $uri = self::URI.$uri_page;
$item['uri'] = $uri;
$picture_html = $this->getSimpleHTMLDOM($uri);
diff --git a/bridges/NeuviemeArtBridge.php b/bridges/NeuviemeArtBridge.php
index 54261c2..6374cf0 100644
--- a/bridges/NeuviemeArtBridge.php
+++ b/bridges/NeuviemeArtBridge.php
@@ -1,10 +1,10 @@
uri.'9emeart.rss';
+ $feedUrl = self::URI.'9emeart.rss';
$html = $this->getSimpleHTMLDOM($feedUrl) or $this->returnServerError('Could not request 9eme Art: '.$feedUrl);
$limit = 0;
@@ -32,9 +32,9 @@ class NeuviemeArtBridge extends BridgeAbstract {
$article_image = $element->find('enclosure', 0)->url;
foreach ($article_html->find('img.img_full') as $img)
if ($img->alt == $article_title)
- $article_image = $this->uri.$img->src;
+ $article_image = self::URI.$img->src;
$article_content = '
'
- .str_replace('src="/', 'src="'.$this->uri, $article_html->find('div.newsGenerique_con', 0)->innertext);
+ .str_replace('src="/', 'src="'.self::URI, $article_html->find('div.newsGenerique_con', 0)->innertext);
$article_content = StripWithDelimiters($article_content, '