From 41dfc571037f6966548f534a609e8b7aae59b417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 20:16:00 +0200 Subject: [PATCH 01/39] [OpenClassroomsBridge] add getURI() + code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/OpenClassroomsBridge.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/bridges/OpenClassroomsBridge.php b/bridges/OpenClassroomsBridge.php index 9e560f9e..39fc87b7 100644 --- a/bridges/OpenClassroomsBridge.php +++ b/bridges/OpenClassroomsBridge.php @@ -10,6 +10,7 @@ class OpenClassroomsBridge extends BridgeAbstract{ 'u'=>array( 'name'=>'Catégorie', 'type'=>'list', + 'required'=>true, 'values'=>array( 'Arts & Culture'=>'arts', 'Code'=>'code', @@ -24,21 +25,18 @@ class OpenClassroomsBridge extends BridgeAbstract{ ) )); + public function getURI(){ + return $this->uri.'/courses?categories='.$this->getInput('u').'&' + .'title=&sort=updatedAt+desc'; + } public function collectData(){ - if (empty($this->getInput('u'))) - { - $this->returnServerError('Error: You must chose a category.'); - } - - $html = ''; - $link = 'https://openclassrooms.com/courses?categories='.$this->getInput('u').'&title=&sort=updatedAt+desc'; - - $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request OpenClassrooms.'); + $html = $this->getSimpleHTMLDOM($this->getURI()) + or $this->returnServerError('Could not request OpenClassrooms.'); foreach($html->find('.courseListItem') as $element) { $item = array(); - $item['uri'] = 'https://openclassrooms.com'.$element->find('a', 0)->href; + $item['uri'] = $this->uri.$element->find('a', 0)->href; $item['title'] = $element->find('h3', 0)->plaintext; $item['content'] = $element->find('slidingItem__descriptionContent', 0)->plaintext; $this->items[] = $item; From 0b4854ccbfacd24c09b1519e99dd36556632d4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 20:23:36 +0200 Subject: [PATCH 02/39] [ParuVenduImmobilierBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ParuVenduImmoBridge.php | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/bridges/ParuVenduImmoBridge.php b/bridges/ParuVenduImmoBridge.php index d3c38460..9f1cfd42 100644 --- a/bridges/ParuVenduImmoBridge.php +++ b/bridges/ParuVenduImmoBridge.php @@ -25,30 +25,8 @@ class ParuVenduImmoBridge extends BridgeAbstract public function collectData() { - $html = ''; - $num = 20; - $appartment = '&tbApp=1&tbDup=1&tbChb=1&tbLof=1&tbAtl=1&tbPla=1'; - $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 ($this->getInput('minarea')) { - $link .= '&sur0='.urlencode($this->getInput('minarea')); - } - - if ($this->getInput('maxprice')) { - $link .= '&px1='.urlencode($this->getInput('maxprice')); - } - - if ($this->getInput('pa')) { - $link .= '&pa='.urlencode($this->getInput('pa')); - } - - if ($this->getInput('lo')) { - $link .= '&lo='.urlencode($this->getInput('lo')); - } - - $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request paruvendu.'); - + $html = $this->getSimpleHTMLDOM($this->getURI()) + or $this->returnServerError('Could not request paruvendu.'); foreach($html->find('div.annonce a') as $element) { @@ -79,16 +57,38 @@ class ParuVenduImmoBridge extends BridgeAbstract } } + public function getURI(){ + $appartment = '&tbApp=1&tbDup=1&tbChb=1&tbLof=1&tbAtl=1&tbPla=1'; + $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 ($this->getInput('minarea')) { + $link .= '&sur0='.urlencode($this->getInput('minarea')); + } + + if ($this->getInput('maxprice')) { + $link .= '&px1='.urlencode($this->getInput('maxprice')); + } + + if ($this->getInput('pa')) { + $link .= '&pa='.urlencode($this->getInput('pa')); + } + + if ($this->getInput('lo')) { + $link .= '&lo='.urlencode($this->getInput('lo')); + } + return $link; + } + public function getName(){ $request=''; - if($this->getInput('minarea') && - !empty($this->getInput('minarea')) - ){ - $request .= ' '.$this->getInput('minarea').' m2'; + $minarea=$this->getInput('minarea'); + if(!empty($minarea)){ + $request .= ' '.$minarea.' m2'; } - if($this->getInput('lo') && - !empty($this->getInput('lo'))){ - $request .= ' In: '.$this->getInput('lo'); + $location=$this->getInput('lo'); + if(!empty($location)){ + $request .= ' In: '.$location; } return 'Paru Vendu Immobilier'.$request; } From 5f0b8434534bc5a73c4bdef242763f357a152736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 20:41:15 +0200 Subject: [PATCH 03/39] [PickyWallpapersBridge] add getURI() + code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/PickyWallpapersBridge.php | 74 +++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/bridges/PickyWallpapersBridge.php b/bridges/PickyWallpapersBridge.php index 6fa77ca0..001cd1d2 100644 --- a/bridges/PickyWallpapersBridge.php +++ b/bridges/PickyWallpapersBridge.php @@ -1,73 +1,73 @@ array('name'=>'category'), + 'c'=>array( + 'name'=>'category', + 'required'=>true + ), 's'=>array('name'=>'subcategory'), 'm'=>array( 'name'=>'Max number of wallpapers', + 'defaultValue'=>12, 'type'=>'number' ), 'r'=>array( 'name'=>'resolution', 'exampleValue'=>'1920x1200, 1680x1050,…', + 'defaultValue'=>'1920x1200', 'pattern'=>'[0-9]{3,4}x[0-9]{3,4}' ) )); public function collectData(){ - $html = ''; - if (!$this->getInput('c')) { - $this->returnClientError('You must specify at least a category (?c=...).'); - } else { - $baseUri = 'http://www.pickywallpapers.com'; + $lastpage = 1; + $num = 0; + $max = $this->getInput('m'); + $resolution = $this->getInput('r'); // Wide wallpaper default - $this->category = $this->getInput('c'); - $this->subcategory = $this->getInput('s') ?: ''; - $this->resolution = $this->getInput('r') ?: '1920x1200'; // Wide wallpaper default + for ($page = 1; $page <= $lastpage; $page++) { + $html = $this->getSimpleHTMLDOM($this->getURI().'/page-'.$page.'/') + or $this->returnServerError('No results for this query.'); - $num = 0; - $max = $this->getInput('m') ?: 12; - $lastpage = 1; + if ($page === 1) { + preg_match('/page-(\d+)\/$/', $html->find('.pages li a', -2)->href, $matches); + $lastpage = min($matches[1], ceil($max/12)); + } - for ($page = 1; $page <= $lastpage; $page++) { - $link = $baseUri.'/'.$this->resolution.'/'.$this->category.'/'.(!empty($this->subcategory)?$this->subcategory.'/':'').'page-'.$page.'/'; - $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('No results for this query.'); + foreach($html->find('.items li img') as $element) { - if ($page === 1) { - preg_match('/page-(\d+)\/$/', $html->find('.pages li a', -2)->href, $matches); - $lastpage = min($matches[1], ceil($max/12)); - } + $item = array(); + $item['uri'] = str_replace('www', 'wallpaper', $this->uri).'/'.$resolution.'/'.basename($element->src); + $item['timestamp'] = time(); + $item['title'] = $element->alt; + $item['content'] = $item['title'].'
'.$element.''; + $this->items[] = $item; - foreach($html->find('.items li img') as $element) { - - $item = array(); - $item['uri'] = str_replace('www', 'wallpaper', $baseUri).'/'.$this->resolution.'/'.basename($element->src); - $item['timestamp'] = time(); - $item['title'] = $element->alt; - $item['content'] = $item['title'].'
'.$element.''; - $this->items[] = $item; - - $num++; - if ($num >= $max) - break 2; - } + $num++; + if ($num >= $max) + break 2; } } } + public function getURI(){ + $subcategory = $this->getInput('s'); + $link = $this->uri.$this->getInput('r').'/'.$this->getInput('c').'/'.$subcategory; + return $link; + } + public function getName(){ - return 'PickyWallpapers - '.$this->category.(!empty($this->subcategory) ? ' > '.$this->subcategory : '').' ['.$this->resolution.']'; + $subcategory = $this->getInput('s'); + return 'PickyWallpapers - '.$this->getInput('c') + .($subcategory? ' > '.$subcategory : '') + .' ['.$this->getInput('r').']'; } public function getCacheDuration(){ From 75f312ea7b36bc5b91baafbe2c2b46b431770cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 21:51:48 +0200 Subject: [PATCH 04/39] [PinterestBridge] add getURI() + code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/PinterestBridge.php | 87 +++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/bridges/PinterestBridge.php b/bridges/PinterestBridge.php index 1bd868ed..8f12e8b2 100644 --- a/bridges/PinterestBridge.php +++ b/bridges/PinterestBridge.php @@ -1,53 +1,41 @@ array( - 'u'=>array('name'=>'username'), - 'b'=>array('name'=>'board') + 'u'=>array( + 'name'=>'username', + 'required'=>true + ), + 'b'=>array( + 'name'=>'board', + 'required'=>true + ) ), 'From search' => array( - 'q'=>array('name'=>'Keyword') + 'q'=>array( + 'name'=>'Keyword', + 'required'=>true + ) ) ); + public function collectData(){ - $html = ''; - if ($this->getInput('u') || $this->getInput('b')) { - - if (empty($this->getInput('u'))) - { - $this->returnClientError('You must specify a Pinterest username (?u=...).'); - } - - if (empty($this->getInput('b'))) - { - $this->returnClientError('You must specify a Pinterest board for this username (?b=...).'); - } - - $this->username = $this->getInput('u'); - $this->board = $this->getInput('b'); - $html = $this->getSimpleHTMLDOM($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnServerError('Username and/or board not found'); - - } else if ($this->getInput('q')) - { - $this->query = $this->getInput('q'); - $html = $this->getSimpleHTMLDOM($this->getURI().'/search/?q='.urlencode($this->query)) or $this->returnServerError('Could not request Pinterest.'); + $html = $this->getSimpleHTMLDOM($this->getURI()) ; + if(!$html){ + switch($this->queriedContext){ + case 'By username and board': + $this->returnServerError('Username and/or board not found'); + case 'From search': + $this->returnServerError('Could not request Pinterest.'); } - - else { - $this->returnClientError('You must specify a Pinterest username and a board name (?u=...&b=...).'); - } - + } foreach($html->find('div.pinWrapper') as $div) { @@ -60,7 +48,7 @@ class PinterestBridge extends BridgeAbstract{ $item['content'] = ''; - if (isset($this->query)) + if ($this->queriedContext==='From search') { $avatar = $div->find('div.creditImg', 0)->find('img', 0); $avatar = $avatar->getAttribute('data-src'); @@ -86,13 +74,28 @@ class PinterestBridge extends BridgeAbstract{ } } - public function getName(){ + public function getURI(){ + switch($this->queriedContext){ + case 'By username and board': + $uri = $this->uri.urlencode($this->getInput('u')).'/'.urlencode($this->getInput('b')); + break; + case 'From search': + $uri = $this->uri.'search/?q='.urlencode($this->getInput('q')); + break; + } - if (isset($this->query)) - { - return $this->query .' - Pinterest'; - } else { - return $this->username .' - '. $this->board.' - Pinterest'; - } + return $uri; + } + + public function getName(){ + switch($this->queriedContext){ + case 'By username and board': + $specific = $this->getInput('u').'-'.$this->getInput('b'); + break; + case 'From search': + $specific = $this->getInput('q'); + break; + } + return $specific .' - '.$this->name; } } From 662c1b6410dbd21ac7308d7de769cd4e034ad451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 21:52:56 +0200 Subject: [PATCH 05/39] [PlanetLibreBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/PlanetLibreBridge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridges/PlanetLibreBridge.php b/bridges/PlanetLibreBridge.php index bfafb48f..6e2024f5 100644 --- a/bridges/PlanetLibreBridge.php +++ b/bridges/PlanetLibreBridge.php @@ -13,7 +13,8 @@ class PlanetLibreBridge extends BridgeAbstract{ } public function collectData(){ - $html = $this->getSimpleHTMLDOM('http://www.planet-libre.org/') or $this->returnServerError('Could not request PlanetLibre.'); + $html = $this->getSimpleHTMLDOM($this->uri) + or $this->returnServerError('Could not request PlanetLibre.'); $limit = 0; foreach($html->find('div.post') as $element) { if($limit < 5) { From 08158825d9a41918745459632172763bea060282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 21:54:25 +0200 Subject: [PATCH 06/39] [ProjectMGameBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ProjectMGameBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/ProjectMGameBridge.php b/bridges/ProjectMGameBridge.php index b7130a23..dad98ddb 100644 --- a/bridges/ProjectMGameBridge.php +++ b/bridges/ProjectMGameBridge.php @@ -8,12 +8,12 @@ class ProjectMGameBridge extends BridgeAbstract{ public function collectData(){ - $html = ''; - $html = $this->getSimpleHTMLDOM('http://projectmgame.com/en/') or $this->returnServerError('Error while downloading the Project M homepage'); + $html = $this->getSimpleHTMLDOM($this->uri) + or $this->returnServerError('Error while downloading the Project M homepage'); foreach($html->find('article') as $article) { $item = array(); - $item['uri'] = 'http://projectmgame.com/en/'.$article->find('section div.info_block a',0)->href; + $item['uri'] = $this->uri.$article->find('section div.info_block a',0)->href; $item['title'] = $article->find('h1 p',0)->innertext; $p_list = $article->find('section p'); From 9f82adc87bca74def1071567bf2b20e3e774a879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:04:26 +0200 Subject: [PATCH 07/39] [RTBFBridge] add getURI() + code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/RTBFBridge.php | 45 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/bridges/RTBFBridge.php b/bridges/RTBFBridge.php index 6097dcfc..cee0f0e9 100644 --- a/bridges/RTBFBridge.php +++ b/bridges/RTBFBridge.php @@ -1,7 +1,7 @@ getInput('c')) { - $html = $this->getSimpleHTMLDOM('http://www.rtbf.be/auvio/emissions/detail?id='.$this->getInput('c')) or $this->returnServerError('Could not request RTBF.'); + $html = $this->getSimpleHTMLDOM($this->getURI()) + or $this->returnServerError('Could not request RTBF.'); - foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) { - if($count < $limit) { - $item = array(); - $item['id'] = $element->getAttribute('data-id'); - $item['uri'] = 'http://www.rtbf.be/auvio/detail?id='.$item['id']; - $thumbnailUriSrcSet = explode(',', $element->find('figure .www-img-16by9 img', 0)->getAttribute('data-srcset')); - $thumbnailUriLastSrc = end($thumbnailUriSrcSet); - $thumbnailUri = explode(' ', $thumbnailUriLastSrc)[0]; - $item['title'] = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext); - $item['timestamp'] = strtotime($element->find('time', 0)->getAttribute('datetime')); - $item['content'] = ''; - $this->items[] = $item; - $count++; - } - } - } - else { - $this->returnClientError('You must specify a series id.'); + foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) { + if($count >= $limit) { + break; + } + $item = array(); + $item['id'] = $element->getAttribute('data-id'); + $item['uri'] = $this->uri.'detail?id='.$item['id']; + $thumbnailUriSrcSet = explode(',', $element->find('figure .www-img-16by9 img', 0)->getAttribute('data-srcset')); + $thumbnailUriLastSrc = end($thumbnailUriSrcSet); + $thumbnailUri = explode(' ', $thumbnailUriLastSrc)[0]; + $item['title'] = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext); + $item['timestamp'] = strtotime($element->find('time', 0)->getAttribute('datetime')); + $item['content'] = ''; + $this->items[] = $item; + $count++; } } + public function getURI(){ + return $this->uri.'detail?id='.$this->getInput('c'); + } + public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'RTBF Bridge'; + return $this->getInput('c') .' - RTBF Bridge'; } public function getCacheDuration(){ From 75a6f8af8ad116e3ba5d8cb9c54d72bf2468d47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:22:33 +0200 Subject: [PATCH 08/39] [Releases3DSBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/Releases3DSBridge.php | 150 +++++++++++++++++----------------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/bridges/Releases3DSBridge.php b/bridges/Releases3DSBridge.php index 25ba50be..3e4ccaea 100644 --- a/bridges/Releases3DSBridge.php +++ b/bridges/Releases3DSBridge.php @@ -32,84 +32,88 @@ class Releases3DSBridge extends BridgeAbstract { } } - $dataUrl = 'http://3dsdb.com/xml.php'; + $dataUrl = $this->uri.'xml.php'; $xml = $this->getContents($dataUrl) or $this->returnServerError('Could not request 3dsdb: '.$dataUrl); $limit = 0; foreach (array_reverse(explode('', $xml)) as $element) { - if ($limit < 5) { - if (strpos($element, '') !== false) { - - $id = ExtractFromDelimiters($element, '', ''); - $name = ExtractFromDelimiters($element, '', ''); - $publisher = ExtractFromDelimiters($element, '', ''); - $region = ExtractFromDelimiters($element, '', ''); - $group = ExtractFromDelimiters($element, '', ''); - $imagesize = ExtractFromDelimiters($element, '', ''); - $serial = ExtractFromDelimiters($element, '', ''); - $titleid = ExtractFromDelimiters($element, '', ''); - $imgcrc = ExtractFromDelimiters($element, '', ''); - $filename = ExtractFromDelimiters($element, '', ''); - $releasename = ExtractFromDelimiters($element, '', ''); - $trimmedsize = ExtractFromDelimiters($element, '', ''); - $firmware = ExtractFromDelimiters($element, '', ''); - $type = ExtractFromDelimiters($element, '', ''); - $card = ExtractFromDelimiters($element, '', ''); - - if (!empty($releasename)) { - - //Retrieve cover art and short desc from IGN? - $ignResult = false; $ignDescription = ''; $ignLink = ''; $ignDate = time(); $ignCoverArt = ''; - $ignSearchUrl = 'http://www.ign.com/search?q='.urlencode($name); - if ($ignResult = $this->getSimpleHTMLDOM($ignSearchUrl)) { - $ignCoverArt = $ignResult->find('div.search-item-media', 0)->find('img', 0)->src; - $ignDesc = $ignResult->find('div.search-item-description', 0)->plaintext; - $ignLink = $ignResult->find('div.search-item-sub-title', 0)->find('a', 1)->href; - $ignDate = strtotime(trim($ignResult->find('span.publish-date', 0)->plaintext)); - $ignDescription = '
'.$ignDesc.' More at IGN
'; - } - - //Main section : Release description from 3DS database - $releaseDescription = '

Release Details

' - .'Release ID: '.$id.'
' - .'Game Name: '.$name.'
' - .'Publisher: '.$publisher.'
' - .'Region: '.$region.'
' - .'Group: '.$group.'
' - .'Image size: '.(intval($imagesize)/8).'MB
' - .'Serial: '.$serial.'
' - .'Title ID: '.$titleid.'
' - .'Image CRC: '.$imgcrc.'
' - .'File Name: '.$filename.'
' - .'Release Name: '.$releasename.'
' - .'Trimmed size: '.intval(intval($trimmedsize)/1048576).'MB
' - .'Firmware: '.$firmware.'
' - .'Type: '.TypeToString($type).'
' - .'Card: '.CardToString($card).'
'; - - //Build search links section to facilitate release search using search engines - $releaseNameEncoded = urlencode(str_replace(' ', '+', $releasename)); - $searchLinkGoogle = 'https://google.com/?q='.$releaseNameEncoded; - $searchLinkDuckDuckGo = 'https://duckduckgo.com/?q='.$releaseNameEncoded; - $searchLinkQwant = 'https://lite.qwant.com/?q='.$releaseNameEncoded.'&t=web'; - $releaseSearchLinks = '

Search this release

'; - - //Build and add final item with the above three sections - $item = array(); - $item['title'] = $name; - $item['author'] = $publisher; - $item['timestamp'] = $ignDate; - $item['uri'] = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink; - $item['content'] = $ignDescription.$releaseDescription.$releaseSearchLinks; - $this->items[] = $item; - $limit++; - } - } + if ($limit >= 5) { + break; } + + if (strpos($element, '') === false) { + continue; + } + + $releasename = ExtractFromDelimiters($element, '', ''); + if (empty($releasename)) { + continue; + } + + $id = ExtractFromDelimiters($element, '', ''); + $name = ExtractFromDelimiters($element, '', ''); + $publisher = ExtractFromDelimiters($element, '', ''); + $region = ExtractFromDelimiters($element, '', ''); + $group = ExtractFromDelimiters($element, '', ''); + $imagesize = ExtractFromDelimiters($element, '', ''); + $serial = ExtractFromDelimiters($element, '', ''); + $titleid = ExtractFromDelimiters($element, '', ''); + $imgcrc = ExtractFromDelimiters($element, '', ''); + $filename = ExtractFromDelimiters($element, '', ''); + $trimmedsize = ExtractFromDelimiters($element, '', ''); + $firmware = ExtractFromDelimiters($element, '', ''); + $type = ExtractFromDelimiters($element, '', ''); + $card = ExtractFromDelimiters($element, '', ''); + + //Retrieve cover art and short desc from IGN? + $ignResult = false; $ignDescription = ''; $ignLink = ''; $ignDate = time(); $ignCoverArt = ''; + $ignSearchUrl = 'http://www.ign.com/search?q='.urlencode($name); + if ($ignResult = $this->getSimpleHTMLDOM($ignSearchUrl)) { + $ignCoverArt = $ignResult->find('div.search-item-media', 0)->find('img', 0)->src; + $ignDesc = $ignResult->find('div.search-item-description', 0)->plaintext; + $ignLink = $ignResult->find('div.search-item-sub-title', 0)->find('a', 1)->href; + $ignDate = strtotime(trim($ignResult->find('span.publish-date', 0)->plaintext)); + $ignDescription = '
'.$ignDesc.' More at IGN
'; + } + + //Main section : Release description from 3DS database + $releaseDescription = '

Release Details

' + .'Release ID: '.$id.'
' + .'Game Name: '.$name.'
' + .'Publisher: '.$publisher.'
' + .'Region: '.$region.'
' + .'Group: '.$group.'
' + .'Image size: '.(intval($imagesize)/8).'MB
' + .'Serial: '.$serial.'
' + .'Title ID: '.$titleid.'
' + .'Image CRC: '.$imgcrc.'
' + .'File Name: '.$filename.'
' + .'Release Name: '.$releasename.'
' + .'Trimmed size: '.intval(intval($trimmedsize)/1048576).'MB
' + .'Firmware: '.$firmware.'
' + .'Type: '.TypeToString($type).'
' + .'Card: '.CardToString($card).'
'; + + //Build search links section to facilitate release search using search engines + $releaseNameEncoded = urlencode(str_replace(' ', '+', $releasename)); + $searchLinkGoogle = 'https://google.com/?q='.$releaseNameEncoded; + $searchLinkDuckDuckGo = 'https://duckduckgo.com/?q='.$releaseNameEncoded; + $searchLinkQwant = 'https://lite.qwant.com/?q='.$releaseNameEncoded.'&t=web'; + $releaseSearchLinks = '

Search this release

'; + + //Build and add final item with the above three sections + $item = array(); + $item['title'] = $name; + $item['author'] = $publisher; + $item['timestamp'] = $ignDate; + $item['uri'] = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink; + $item['content'] = $ignDescription.$releaseDescription.$releaseSearchLinks; + $this->items[] = $item; + $limit++; } } From 927ae17d5ca8f07ae58da46c2e3e8c2f14713eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:23:24 +0200 Subject: [PATCH 09/39] [ReporterreBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ReporterreBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/ReporterreBridge.php b/bridges/ReporterreBridge.php index 8596942c..676604ba 100644 --- a/bridges/ReporterreBridge.php +++ b/bridges/ReporterreBridge.php @@ -24,7 +24,7 @@ class ReporterreBridge extends BridgeAbstract{ } public function collectData(){ - $html = $this->getSimpleHTMLDOM('http://www.reporterre.net/spip.php?page=backend') or $this->returnServerError('Could not request Reporterre.'); + $html = $this->getSimpleHTMLDOM($this->uri.'spip.php?page=backend') or $this->returnServerError('Could not request Reporterre.'); $limit = 0; foreach($html->find('item') as $element) { From 5704b6e3c4ca72828b390705038b5b9fab014e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:26:06 +0200 Subject: [PATCH 10/39] [Rule34Bridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/Rule34Bridge.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/bridges/Rule34Bridge.php b/bridges/Rule34Bridge.php index d18297b0..436b9097 100644 --- a/bridges/Rule34Bridge.php +++ b/bridges/Rule34Bridge.php @@ -15,21 +15,16 @@ class Rule34Bridge extends BridgeAbstract{ )); public function collectData(){ - $page = 0;$tags=''; - if ($this->getInput('p')) { - $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p')); - $page = $page - 1; - $page = $page * 50; - } - if ($this->getInput('t')) { - $tags = urlencode($this->getInput('t')); - } - $html = $this->getSimpleHTMLDOM("http://rule34.xxx/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Rule34.'); + $html = $this->getSimpleHTMLDOM( + $this->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 Rule34.'); foreach($html->find('div[class=content] span') as $element) { $item = array(); - $item['uri'] = 'http://rule34.xxx/'.$element->find('a', 0)->href; + $item['uri'] = $this->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; From 10d5bb630fd35affe4de4a7c7a1c6465231a6a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:28:30 +0200 Subject: [PATCH 11/39] [Rule34pahealBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/Rule34pahealBridge.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bridges/Rule34pahealBridge.php b/bridges/Rule34pahealBridge.php index 2a4a61db..af3608ed 100644 --- a/bridges/Rule34pahealBridge.php +++ b/bridges/Rule34pahealBridge.php @@ -16,19 +16,13 @@ class Rule34pahealBridge extends BridgeAbstract{ public function collectData(){ - $page = 0;$tags=''; - if ($this->getInput('p')) { - $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p')); - } - if ($this->getInput('t')) { - $tags = urlencode($this->getInput('t')); - } - $html = $this->getSimpleHTMLDOM("http://rule34.paheal.net/post/list/$tags/$page") or $this->returnServerError('Could not request Rule34paheal.'); + $html = $this->getSimpleHTMLDOM($this->uri.'post/list/'.$tags.'/'.$page) + or $this->returnServerError('Could not request Rule34paheal.'); foreach($html->find('div[class=shm-image-list] div[class=shm-thumb]') as $element) { $item = array(); - $item['uri'] = 'http://rule34.paheal.net'.$element->find('a', 0)->href; + $item['uri'] = $this->uri.$element->find('a', 0)->href; $item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->find('img', 0)->getAttribute('id')); $item['timestamp'] = time(); $thumbnailUri = $element->find('img', 0)->src; From 1172bea2db0dffdd813c37b946a4a9d4a4c18539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:30:38 +0200 Subject: [PATCH 12/39] [SafebooruBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SafebooruBridge.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bridges/SafebooruBridge.php b/bridges/SafebooruBridge.php index 495a8391..93975521 100644 --- a/bridges/SafebooruBridge.php +++ b/bridges/SafebooruBridge.php @@ -15,21 +15,15 @@ class SafebooruBridge extends BridgeAbstract{ )); public function collectData(){ - $page = 0;$tags=''; - if ($this->getInput('p')) { - $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p')); - $page = $page - 1; - $page = $page * 40; - } - if ($this->getInput('t')) { - $tags = urlencode($this->getInput('t')); - } - $html = $this->getSimpleHTMLDOM("http://safebooru.org/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Safebooru.'); - + $html = $this->getSimpleHTMLDOM( + $this->uri.'index.php?page=post&s=list&' + .'&pid='.($this->getInput('p')?($this->getInput('p') -1)*40:'') + .'&tags='.urlencode($this->getInput('t')) + ) or $this->returnServerError('Could not request Safebooru.'); foreach($html->find('div[class=content] span') as $element) { $item = array(); - $item['uri'] = 'http://safebooru.org/'.$element->find('a', 0)->href; + $item['uri'] = $this->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; From 92e0bec9256ed9f42aee3882c313ea58349eb382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:33:24 +0200 Subject: [PATCH 13/39] [SakugabooruBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SakugabooruBridge.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bridges/SakugabooruBridge.php b/bridges/SakugabooruBridge.php index ab74d6db..c83eee5e 100644 --- a/bridges/SakugabooruBridge.php +++ b/bridges/SakugabooruBridge.php @@ -9,20 +9,19 @@ class SakugabooruBridge extends BridgeAbstract{ public $parameters = array( array( 'p'=>array( 'name'=>'page', + 'defaultValue'=>1, 'type'=>'number' ), 't'=>array('name'=>'tags') )); public function collectData(){ - $page = 1;$tags=''; - if ($this->getInput('p')) { - $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p')); - } - if ($this->getInput('t')) { - $tags = urlencode($this->getInput('t')); - } - $html = $this->getSimpleHTMLDOM("http://sakuga.yshi.org/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Sakugabooru.'); + $html = $this->getSimpleHTMLDOM( + $this->uri.'post?' + .'&page='.$this->getInput('p') + .'&tags='.urlencode($this->getInput('t')) + ) or $this->returnServerError('Could not request Sakugabooru.'); + $input_json = explode('Post.register(', $html); foreach($input_json as $element) $data[] = preg_replace('/}\)(.*)/', '}', $element); @@ -31,7 +30,7 @@ class SakugabooruBridge extends BridgeAbstract{ foreach($data as $datai) { $json = json_decode($datai, TRUE); $item = array(); - $item['uri'] = 'http://sakuga.yshi.org/post/show/'.$json['id']; + $item['uri'] = $this->uri.'/post/show/'.$json['id']; $item['postid'] = $json['id']; $item['timestamp'] = $json['created_at']; $item['imageUri'] = $json['file_url']; From b1d9d887727f2dcbff1596175388bddf098a4259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:34:38 +0200 Subject: [PATCH 14/39] [ScmBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ScmbBridge.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridges/ScmbBridge.php b/bridges/ScmbBridge.php index 9e5997e1..0e0974b6 100644 --- a/bridges/ScmbBridge.php +++ b/bridges/ScmbBridge.php @@ -8,11 +8,12 @@ class ScmbBridge extends BridgeAbstract{ public function collectData(){ $html = ''; - $html = $this->getSimpleHTMLDOM('http://secouchermoinsbete.fr/') or $this->returnServerError('Could not request Se Coucher Moins Bete.'); + $html = $this->getSimpleHTMLDOM($this->uri) + or $this->returnServerError('Could not request Se Coucher Moins Bete.'); foreach($html->find('article') as $article) { $item = array(); - $item['uri'] = 'http://secouchermoinsbete.fr'.$article->find('p.summary a',0)->href; + $item['uri'] = $this->uri.$article->find('p.summary a',0)->href; $item['title'] = $article->find('header h1 a',0)->innertext; $article->find('span.read-more',0)->outertext=''; // remove text "En savoir plus" from anecdote content From aed7815f05210eb7a7556d17feecf36564d1e831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:37:19 +0200 Subject: [PATCH 15/39] [ScoopitBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/ScoopItBridge.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/bridges/ScoopItBridge.php b/bridges/ScoopItBridge.php index 32bdc471..db42428e 100644 --- a/bridges/ScoopItBridge.php +++ b/bridges/ScoopItBridge.php @@ -3,7 +3,7 @@ class ScoopItBridge extends BridgeAbstract{ public $maintainer = "Pitchoule"; public $name = "ScoopIt"; - public $uri = "http://www.scoop.it"; + public $uri = "http://www.scoop.it/"; public $description = "Returns most recent results from ScoopIt."; public $parameters = array( array( @@ -14,23 +14,19 @@ class ScoopItBridge extends BridgeAbstract{ )); public function collectData(){ - $html = ''; - if ($this->getInput('u') != '') { - $this->request = $this->getInput('u'); - $link = 'http://scoop.it/search?q=' .urlencode($this->request); + $this->request = $this->getInput('u'); + $link = $this->uri.'search?q=' .urlencode($this->getInput('u')); - $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request ScoopIt. for : ' . $link); + $html = $this->getSimpleHTMLDOM($link) + or $this->returnServerError('Could not request ScoopIt. for : ' . $link); - foreach($html->find('div.post-view') as $element) { - $item = array(); - $item['uri'] = $element->find('a', 0)->href; - $item['title'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_title',0)->plaintext); - $item['content'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_description', 0)->plaintext); - $this->items[] = $item; - } - } else { - $this->returnServerError('You must specify a keyword'); - } + foreach($html->find('div.post-view') as $element) { + $item = array(); + $item['uri'] = $element->find('a', 0)->href; + $item['title'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_title',0)->plaintext); + $item['content'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_description', 0)->plaintext); + $this->items[] = $item; + } } public function getCacheDuration(){ From 82b150baa8c9a2d1211e336404295f594197e96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:53:38 +0200 Subject: [PATCH 16/39] [SensCritiqueBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SensCritiqueBridge.php | 84 ++++++++-------------------------- 1 file changed, 20 insertions(+), 64 deletions(-) diff --git a/bridges/SensCritiqueBridge.php b/bridges/SensCritiqueBridge.php index f3d1a2df..a202e0c9 100644 --- a/bridges/SensCritiqueBridge.php +++ b/bridges/SensCritiqueBridge.php @@ -3,7 +3,7 @@ class SensCritiqueBridge extends BridgeAbstract { public $maintainer = "kranack"; public $name = "Sens Critique"; - public $uri = "http://www.senscritique.com"; + public $uri = "http://www.senscritique.com/"; public $description = "Sens Critique news"; public $parameters = array( array( @@ -34,71 +34,27 @@ class SensCritiqueBridge extends BridgeAbstract { )); public function collectData(){ - if (($this->getInput('m') && $this->getInput('m'))) { - $this->collectMoviesData(); - } else if (($this->getInput('s') && $this->getInput('s'))) { - $this->collectSeriesData(); - } else if (($this->getInput('g') && $this->getInput('g'))) { - $this->collectGamesData(); - } else if (($this->getInput('b') && $this->getInput('b'))) { - $this->collectBooksData(); - } else if (($this->getInput('bd') && $this->getInput('bd'))) { - $this->collectBDsData(); - } else if (($this->getInput('mu') && $this->getInput('mu'))) { - $this->collectMusicsData(); - } else { - $this->returnClientError('You must choose a category'); - } + $categories=array(); + foreach($this->parameters[$this->queriedContext] as $category=>$properties){ + if($this->getInput($category)){ + $uri=$this->uri; + switch($category){ + case 'm': $uri.='films/cette-semaine'; break; + case 's': $uri.='series/actualite'; break; + case 'g': $uri.='jeuxvideo/actualite'; break; + case 'b': $uri.='livres/actualite'; break; + case 'bd': $uri.='bd/actualite'; break; + case 'mu': $uri.='musique/actualite'; break; + } + $html = $this->getSimpleHTMLDOM($uri) + or $this->returnServerError('No results for this query.'); + $list = $html->find('ul.elpr-list', 0); + + $this->extractDataFromList($list); + } + } } - private function collectMoviesData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/films/cette-semaine') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - - private function collectSeriesData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/series/actualite') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - - private function collectGamesData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/jeuxvideo/actualite') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - - private function collectBooksData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/livres/actualite') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - - private function collectBDsData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/bd/actualite') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - - private function collectMusicsData() { - $html = ''; - $html = $this->getSimpleHTMLDOM('http://www.senscritique.com/musique/actualite') or $this->returnServerError('No results for this query.'); - $list = $html->find('ul.elpr-list', 0); - - $this->extractDataFromList($list); - } - private function extractDataFromList($list) { if ($list === null) { $this->returnClientError('Cannot extract data from list'); From a88ad96ad98bb5515062f96e03d957e7fec3f351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 22:59:26 +0200 Subject: [PATCH 17/39] [SiliconBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SiliconBridge.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bridges/SiliconBridge.php b/bridges/SiliconBridge.php index f821bcf9..fffccaa4 100644 --- a/bridges/SiliconBridge.php +++ b/bridges/SiliconBridge.php @@ -14,8 +14,9 @@ class SiliconBridge extends BridgeAbstract { return $string; } - $feedUrl = 'http://www.silicon.fr/feed'; - $html = $this->getSimpleHTMLDOM($feedUrl) or $this->returnServerError('Could not request Silicon: '.$feedUrl); + $feedUrl = $this->uri.'feed'; + $html = $this->getSimpleHTMLDOM($feedUrl) + or $this->returnServerError('Could not request Silicon: '.$feedUrl); $limit = 0; foreach($html->find('item') as $element) { @@ -25,7 +26,8 @@ class SiliconBridge extends BridgeAbstract { $article_uri = $element->innertext; $article_uri = substr($article_uri, strpos($article_uri, '') + 6); $article_uri = substr($article_uri, 0, strpos($article_uri, '')); - $article_html = $this->getSimpleHTMLDOM($article_uri) or $this->returnServerError('Could not request Silicon: '.$article_uri); + $article_html = $this->getSimpleHTMLDOM($article_uri) + or $this->returnServerError('Could not request Silicon: '.$article_uri); //Build article contents from corresponding elements $thumbnailUri = $element->find('enclosure', 0)->url; From cf70e43f59ad0c95f1dbba8442e0b91056f64ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Mon, 29 Aug 2016 23:03:33 +0200 Subject: [PATCH 18/39] [SoundcloudBridge] code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- bridges/SoundcloudBridge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php index be22cd7c..55304e50 100644 --- a/bridges/SoundcloudBridge.php +++ b/bridges/SoundcloudBridge.php @@ -3,7 +3,7 @@ class SoundCloudBridge extends BridgeAbstract{ public $maintainer = "kranack"; public $name = "Soundcloud Bridge"; - public $uri = "http://www.soundcloud.com/"; + public $uri = "https://soundcloud.com/"; public $description = "Returns 10 newest music from user profile"; public $parameters = array( array( @@ -33,10 +33,10 @@ class SoundCloudBridge extends BridgeAbstract{ $item['author'] = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item['title'] = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item['content'] = '