phpcs: Fix violations
This commit is contained in:
parent
e295dc5a79
commit
392e3ff6c7
30 changed files with 76 additions and 76 deletions
|
@ -8,7 +8,7 @@ class ABCTabsBridge extends BridgeAbstract {
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = '';
|
$html = '';
|
||||||
$html = getSimpleHTMLDOM(static::URI.'tablatures/nouveautes.html')
|
$html = getSimpleHTMLDOM(static::URI . 'tablatures/nouveautes.html')
|
||||||
or returnClientError('No results for this query.');
|
or returnClientError('No results for this query.');
|
||||||
|
|
||||||
$table = $html->find('table#myTable', 0)->children(1);
|
$table = $html->find('table#myTable', 0)->children(1);
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AllocineFRBridge extends BridgeAbstract {
|
||||||
public function getName(){
|
public function getName(){
|
||||||
if(!is_null($this->getInput('category'))) {
|
if(!is_null($this->getInput('category'))) {
|
||||||
return self::NAME . ' : '
|
return self::NAME . ' : '
|
||||||
.array_search(
|
. array_search(
|
||||||
$this->getInput('category'),
|
$this->getInput('category'),
|
||||||
self::PARAMETERS[$this->queriedContext]['category']['values']
|
self::PARAMETERS[$this->queriedContext]['category']['values']
|
||||||
);
|
);
|
||||||
|
|
|
@ -52,7 +52,7 @@ class AmazonBridge extends BridgeAbstract {
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))) {
|
if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))) {
|
||||||
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
|
return 'Amazon.' . $this->getInput('tld') . ': ' . $this->getInput('q');
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::getName();
|
return parent::getName();
|
||||||
|
@ -60,8 +60,8 @@ class AmazonBridge extends BridgeAbstract {
|
||||||
|
|
||||||
public function collectData() {
|
public function collectData() {
|
||||||
|
|
||||||
$uri = 'https://www.amazon.'.$this->getInput('tld').'/';
|
$uri = 'https://www.amazon.' . $this->getInput('tld') . '/';
|
||||||
$uri .= 's/?field-keywords='.urlencode($this->getInput('q')).'&sort='.$this->getInput('sort');
|
$uri .= 's/?field-keywords=' . urlencode($this->getInput('q')) . '&sort=' . $this->getInput('sort');
|
||||||
|
|
||||||
$html = getSimpleHTMLDOM($uri)
|
$html = getSimpleHTMLDOM($uri)
|
||||||
or returnServerError('Could not request Amazon.');
|
or returnServerError('Could not request Amazon.');
|
||||||
|
@ -86,7 +86,7 @@ class AmazonBridge extends BridgeAbstract {
|
||||||
$price = $element->find('span.s-price', 0);
|
$price = $element->find('span.s-price', 0);
|
||||||
$price = ($price) ? $price->innertext : '';
|
$price = ($price) ? $price->innertext : '';
|
||||||
|
|
||||||
$item['content'] = '<img src="'.$image->getAttribute('src').'" /><br />'.$price;
|
$item['content'] = '<img src="' . $image->getAttribute('src') . '" /><br />' . $price;
|
||||||
|
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ class AnidexBridge extends BridgeAbstract {
|
||||||
if (strpos($link->href, '/torrent/') === 0 && !in_array($link->href, $results))
|
if (strpos($link->href, '/torrent/') === 0 && !in_array($link->href, $results))
|
||||||
$results[] = $link->href;
|
$results[] = $link->href;
|
||||||
if (empty($results) && empty($this->getInput('q')))
|
if (empty($results) && empty($this->getInput('q')))
|
||||||
returnServerError('No results from Anidex: '.$search_url);
|
returnServerError('No results from Anidex: ' . $search_url);
|
||||||
|
|
||||||
//Process each item individually
|
//Process each item individually
|
||||||
foreach ($results as $element) {
|
foreach ($results as $element) {
|
||||||
|
@ -156,7 +156,7 @@ class AnidexBridge extends BridgeAbstract {
|
||||||
if ($torrent_id != 0 && ctype_digit($torrent_id)) {
|
if ($torrent_id != 0 && ctype_digit($torrent_id)) {
|
||||||
|
|
||||||
//Retrieve data for this torrent ID
|
//Retrieve data for this torrent ID
|
||||||
$item_uri = self::URI . 'torrent/'.$torrent_id;
|
$item_uri = self::URI . 'torrent/' . $torrent_id;
|
||||||
|
|
||||||
//Retrieve full description from torrent page
|
//Retrieve full description from torrent page
|
||||||
if ($item_html = getSimpleHTMLDOMCached($item_uri)) {
|
if ($item_html = getSimpleHTMLDOMCached($item_uri)) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ class AutoJMBridge extends BridgeAbstract {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = $url;
|
$item['uri'] = $url;
|
||||||
$item['title'] = $serie;
|
$item['title'] = $serie;
|
||||||
$item['content'] = '<p><img style="vertical-align:middle ; padding: 10px" src="' . $image . '" />'. $serie . '</p>';
|
$item['content'] = '<p><img style="vertical-align:middle ; padding: 10px" src="' . $image . '" />' . $serie . '</p>';
|
||||||
$item['content'] .= '<ul><li>Disponibilité : ' . $dispo . '</li>';
|
$item['content'] .= '<ul><li>Disponibilité : ' . $dispo . '</li>';
|
||||||
$item['content'] .= '<li>Carburant : ' . $carburant . '</li>';
|
$item['content'] .= '<li>Carburant : ' . $carburant . '</li>';
|
||||||
$item['content'] .= '<li>Transmission : ' . $transmission . '</li>';
|
$item['content'] .= '<li>Transmission : ' . $transmission . '</li>';
|
||||||
|
|
|
@ -52,9 +52,9 @@ class CNETBridge extends BridgeAbstract {
|
||||||
returnClientError('Invalid topic: ' . $topic);
|
returnClientError('Invalid topic: ' . $topic);
|
||||||
|
|
||||||
// Retrieve webpage
|
// Retrieve webpage
|
||||||
$pageUrl = self::URI . (empty($topic) ? 'news/' : $topic.'/');
|
$pageUrl = self::URI . (empty($topic) ? 'news/' : $topic . '/');
|
||||||
$html = getSimpleHTMLDOM($pageUrl)
|
$html = getSimpleHTMLDOM($pageUrl)
|
||||||
or returnServerError('Could not request CNET: '.$pageUrl);
|
or returnServerError('Could not request CNET: ' . $pageUrl);
|
||||||
|
|
||||||
// Process articles
|
// Process articles
|
||||||
foreach($html->find('div.assetBody, div.riverPost') as $element) {
|
foreach($html->find('div.assetBody, div.riverPost') as $element) {
|
||||||
|
|
|
@ -1074,10 +1074,10 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
$url = $this->i8n('bridge-uri')
|
$url = $this->i8n('bridge-uri')
|
||||||
. '/search/advanced?q='
|
. '/search/advanced?q='
|
||||||
. urlencode($q)
|
. urlencode($q)
|
||||||
. '&hide_expired='. $hide_expired
|
. '&hide_expired=' . $hide_expired
|
||||||
. '&hide_local='. $hide_local
|
. '&hide_local=' . $hide_local
|
||||||
. '&priceFrom='. $priceFrom
|
. '&priceFrom=' . $priceFrom
|
||||||
. '&priceTo='. $priceTo
|
. '&priceTo=' . $priceTo
|
||||||
/* Some default parameters
|
/* Some default parameters
|
||||||
* search_fields : Search in Titres & Descriptions & Codes
|
* search_fields : Search in Titres & Descriptions & Codes
|
||||||
* sort_by : Sort the search by new deals
|
* sort_by : Sort the search by new deals
|
||||||
|
@ -1152,30 +1152,30 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
foreach ($list as $deal) {
|
foreach ($list as $deal) {
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = $deal->find('div[class=threadGrid-title]', 0)->find('a', 0)->href;
|
$item['uri'] = $deal->find('div[class=threadGrid-title]', 0)->find('a', 0)->href;
|
||||||
$item['title'] = $deal->find('a[class*='. $selectorLink .']', 0
|
$item['title'] = $deal->find('a[class*=' . $selectorLink . ']', 0
|
||||||
)->plaintext;
|
)->plaintext;
|
||||||
$item['author'] = $deal->find('span.thread-username', 0)->plaintext;
|
$item['author'] = $deal->find('span.thread-username', 0)->plaintext;
|
||||||
$item['content'] = '<table><tr><td><a href="'
|
$item['content'] = '<table><tr><td><a href="'
|
||||||
. $deal->find(
|
. $deal->find(
|
||||||
'a[class*='. $selectorImageLink .']', 0)->href
|
'a[class*=' . $selectorImageLink . ']', 0)->href
|
||||||
. '"><img src="'
|
. '"><img src="'
|
||||||
. $this->getImage($deal)
|
. $this->getImage($deal)
|
||||||
. '"/></td><td><h2><a href="'
|
. '"/></td><td><h2><a href="'
|
||||||
. $deal->find('a[class*='. $selectorLink .']', 0)->href
|
. $deal->find('a[class*=' . $selectorLink . ']', 0)->href
|
||||||
. '">'
|
. '">'
|
||||||
. $deal->find('a[class*='. $selectorLink .']', 0)->innertext
|
. $deal->find('a[class*=' . $selectorLink . ']', 0)->innertext
|
||||||
. '</a></h2>'
|
. '</a></h2>'
|
||||||
. $this->getPrice($deal)
|
. $this->getPrice($deal)
|
||||||
. $this->getDiscount($deal)
|
. $this->getDiscount($deal)
|
||||||
. $this->getShipsFrom($deal)
|
. $this->getShipsFrom($deal)
|
||||||
. $this->getShippingCost($deal)
|
. $this->getShippingCost($deal)
|
||||||
. $this->GetSource($deal)
|
. $this->GetSource($deal)
|
||||||
. $deal->find('div[class*='. $selectorDescription .']', 0)->innertext
|
. $deal->find('div[class*=' . $selectorDescription . ']', 0)->innertext
|
||||||
. '</td><td>'
|
. '</td><td>'
|
||||||
. $deal->find('div[class*='. $selectorHot .']', 0)
|
. $deal->find('div[class*=' . $selectorHot . ']', 0)
|
||||||
->find('span', 1)->outertext
|
->find('span', 1)->outertext
|
||||||
. '</td></table>';
|
. '</td></table>';
|
||||||
$dealDateDiv = $deal->find('div[class*='. $selectorDate .']', 0)
|
$dealDateDiv = $deal->find('div[class*=' . $selectorDate . ']', 0)
|
||||||
->find('span[class=hide--toW3]');
|
->find('span[class=hide--toW3]');
|
||||||
$itemDate = end($dealDateDiv)->plaintext;
|
$itemDate = end($dealDateDiv)->plaintext;
|
||||||
// In case of a Local deal, there is no date, but we can use
|
// In case of a Local deal, there is no date, but we can use
|
||||||
|
@ -1214,7 +1214,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
{
|
{
|
||||||
if ($deal->find(
|
if ($deal->find(
|
||||||
'span[class*=thread-price]', 0) != null) {
|
'span[class*=thread-price]', 0) != null) {
|
||||||
return '<div>'.$this->i8n('price') .' : '
|
return '<div>' . $this->i8n('price') . ' : '
|
||||||
. $deal->find(
|
. $deal->find(
|
||||||
'span[class*=thread-price]', 0
|
'span[class*=thread-price]', 0
|
||||||
)->plaintext
|
)->plaintext
|
||||||
|
@ -1233,11 +1233,11 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
{
|
{
|
||||||
if ($deal->find('span[class*=cept-shipping-price]', 0) != null) {
|
if ($deal->find('span[class*=cept-shipping-price]', 0) != null) {
|
||||||
if ($deal->find('span[class*=cept-shipping-price]', 0)->children(0) != null) {
|
if ($deal->find('span[class*=cept-shipping-price]', 0)->children(0) != null) {
|
||||||
return '<div>'. $this->i8n('shipping') .' : '
|
return '<div>' . $this->i8n('shipping') . ' : '
|
||||||
. $deal->find('span[class*=cept-shipping-price]', 0)->children(0)->innertext
|
. $deal->find('span[class*=cept-shipping-price]', 0)->children(0)->innertext
|
||||||
. '</div>';
|
. '</div>';
|
||||||
} else {
|
} else {
|
||||||
return '<div>'. $this->i8n('shipping') .' : '
|
return '<div>' . $this->i8n('shipping') . ' : '
|
||||||
. $deal->find('span[class*=cept-shipping-price]', 0)->innertext
|
. $deal->find('span[class*=cept-shipping-price]', 0)->innertext
|
||||||
. '</div>';
|
. '</div>';
|
||||||
}
|
}
|
||||||
|
@ -1253,7 +1253,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
private function GetSource($deal)
|
private function GetSource($deal)
|
||||||
{
|
{
|
||||||
if ($deal->find('a[class=text--color-greyShade]', 0) != null) {
|
if ($deal->find('a[class=text--color-greyShade]', 0) != null) {
|
||||||
return '<div>'. $this->i8n('origin') .' : '
|
return '<div>' . $this->i8n('origin') . ' : '
|
||||||
. $deal->find('a[class=text--color-greyShade]', 0)->outertext
|
. $deal->find('a[class=text--color-greyShade]', 0)->outertext
|
||||||
. '</div>';
|
. '</div>';
|
||||||
} else {
|
} else {
|
||||||
|
@ -1274,7 +1274,7 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
} else {
|
} else {
|
||||||
$discount = '';
|
$discount = '';
|
||||||
}
|
}
|
||||||
return '<div>'. $this->i8n('discount') .' : <span style="text-decoration: line-through;">'
|
return '<div>' . $this->i8n('discount') . ' : <span style="text-decoration: line-through;">'
|
||||||
. $deal->find(
|
. $deal->find(
|
||||||
'span[class*=mute--text text--lineThrough]', 0
|
'span[class*=mute--text text--lineThrough]', 0
|
||||||
)->plaintext
|
)->plaintext
|
||||||
|
@ -1315,13 +1315,13 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
'cept-thread-img'
|
'cept-thread-img'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($deal->find('img[class='. $selectorLazy .']', 0) != null) {
|
if ($deal->find('img[class=' . $selectorLazy . ']', 0) != null) {
|
||||||
return json_decode(
|
return json_decode(
|
||||||
html_entity_decode(
|
html_entity_decode(
|
||||||
$deal->find('img[class='. $selectorLazy .']', 0)
|
$deal->find('img[class=' . $selectorLazy . ']', 0)
|
||||||
->getAttribute('data-lazy-img')))->{'src'};
|
->getAttribute('data-lazy-img')))->{'src'};
|
||||||
} else {
|
} else {
|
||||||
return $deal->find('img[class*='. $selectorPlain .']', 0 )->src;
|
return $deal->find('img[class*=' . $selectorPlain . ']', 0 )->src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1340,9 +1340,9 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
'text--color-greyShade'
|
'text--color-greyShade'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($deal->find('span[class='. $selector .']', 0) != null) {
|
if ($deal->find('span[class=' . $selector . ']', 0) != null) {
|
||||||
return '<div>'
|
return '<div>'
|
||||||
. $deal->find('span[class='. $selector .']', 0)->children(2)->plaintext
|
. $deal->find('span[class=' . $selector . ']', 0)->children(2)->plaintext
|
||||||
. '</div>';
|
. '</div>';
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
@ -1445,12 +1445,12 @@ class PepperBridgeAbstract extends BridgeAbstract {
|
||||||
public function getName(){
|
public function getName(){
|
||||||
switch($this->queriedContext) {
|
switch($this->queriedContext) {
|
||||||
case $this->i8n('context-keyword'):
|
case $this->i8n('context-keyword'):
|
||||||
return $this->i8n('bridge-name') . ' - '. $this->i8n('title-keyword') .' : '. $this->getInput('q');
|
return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');
|
||||||
break;
|
break;
|
||||||
case $this->i8n('context-group'):
|
case $this->i8n('context-group'):
|
||||||
$values = $this->getParameters()[$this->i8n('context-group')]['group']['values'];
|
$values = $this->getParameters()[$this->i8n('context-group')]['group']['values'];
|
||||||
$group = array_search($this->getInput('group'), $values);
|
$group = array_search($this->getInput('group'), $values);
|
||||||
return $this->i8n('bridge-name') . ' - '. $this->i8n('title-group'). ' : '. $group;
|
return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $group;
|
||||||
break;
|
break;
|
||||||
default: // Return default value
|
default: // Return default value
|
||||||
return static::NAME;
|
return static::NAME;
|
||||||
|
|
|
@ -81,7 +81,7 @@ class DiscogsBridge extends BridgeAbstract {
|
||||||
. $this->getInput('username_folder')
|
. $this->getInput('username_folder')
|
||||||
. '/collection/folders/'
|
. '/collection/folders/'
|
||||||
. $this->getInput('folderid')
|
. $this->getInput('folderid')
|
||||||
.'/releases?sort=added&sort_order=desc')
|
. '/releases?sort=added&sort_order=desc')
|
||||||
or returnServerError('Unable to query discogs !');
|
or returnServerError('Unable to query discogs !');
|
||||||
$jsonData = json_decode($data, true)['releases'];
|
$jsonData = json_decode($data, true)['releases'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ class ETTVBridge extends BridgeAbstract {
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
// No control on inputs, because all defaultValue are set
|
// No control on inputs, because all defaultValue are set
|
||||||
$query_str = 'torrents-search.php';
|
$query_str = 'torrents-search.php';
|
||||||
$query_str .= '?search=' . urlencode('+'.str_replace(' ', ' +', $this->getInput('query')));
|
$query_str .= '?search=' . urlencode('+' . str_replace(' ', ' +', $this->getInput('query')));
|
||||||
$query_str .= '&cat=' . $this->getInput('cat');
|
$query_str .= '&cat=' . $this->getInput('cat');
|
||||||
$query_str .= '&incldead=' . $this->getInput('status');
|
$query_str .= '&incldead=' . $this->getInput('status');
|
||||||
$query_str .= '&lang=' . $this->getInput('lang');
|
$query_str .= '&lang=' . $this->getInput('lang');
|
||||||
|
|
|
@ -167,7 +167,7 @@ EOD;
|
||||||
if($sectionContent != null) {
|
if($sectionContent != null) {
|
||||||
$sectionLink = $sectionContent->nextSibling();
|
$sectionLink = $sectionContent->nextSibling();
|
||||||
if($sectionLink != null) {
|
if($sectionLink != null) {
|
||||||
$fullLink = '<a href="' . $sectionLink->getAttribute('href') . '">' . $sectionContent->innertext . '</a>';
|
$fullLink = '<a href="' . $sectionLink->getAttribute('href') . '">' . $sectionContent->innertext . '</a>';
|
||||||
$sectionContent->innertext = $fullLink;
|
$sectionContent->innertext = $fullLink;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ EOD;
|
||||||
foreach($content->find('section > a') as $sectionToFix) {
|
foreach($content->find('section > a') as $sectionToFix) {
|
||||||
$sectionLink = $sectionToFix->getAttribute('href');
|
$sectionLink = $sectionToFix->getAttribute('href');
|
||||||
$section = $sectionToFix->parent();
|
$section = $sectionToFix->parent();
|
||||||
$section->outertext = '<a href="' . $sectionLink . '">' . $section . '</a>';
|
$section->outertext = '<a href="' . $sectionLink . '">' . $section . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['content'] = html_entity_decode($content, ENT_QUOTES);
|
$item['content'] = html_entity_decode($content, ENT_QUOTES);
|
||||||
|
|
|
@ -49,9 +49,9 @@ class FDroidBridge extends BridgeAbstract {
|
||||||
$item['icon'] = $element->find('img', 0)->src;
|
$item['icon'] = $element->find('img', 0)->src;
|
||||||
$item['summary'] = $element->find('span.package-summary', 0)->plaintext;
|
$item['summary'] = $element->find('span.package-summary', 0)->plaintext;
|
||||||
$item['content'] = '
|
$item['content'] = '
|
||||||
<a href="'.$item['uri'].'">
|
<a href="' . $item['uri'] . '">
|
||||||
<img alt="" style="max-height:128px" src="'.$item['icon'].'">
|
<img alt="" style="max-height:128px" src="' . $item['icon'] . '">
|
||||||
</a><br>'.$item['summary'];
|
</a><br>' . $item['summary'];
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ class FourchanBridge extends BridgeAbstract {
|
||||||
. '" src="'
|
. '" src="'
|
||||||
. $item['imageThumb']
|
. $item['imageThumb']
|
||||||
. '" /></a><br>'
|
. '" /></a><br>'
|
||||||
.$item['content'];
|
. $item['content'];
|
||||||
}
|
}
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class GBAtempBridge extends BridgeAbstract {
|
||||||
|
|
||||||
private function cleanupPostContent($content, $site_url){
|
private function cleanupPostContent($content, $site_url){
|
||||||
$content = str_replace(':arrow:', '➤', $content);
|
$content = str_replace(':arrow:', '➤', $content);
|
||||||
$content = str_replace('href="attachments/', 'href="'.$site_url.'attachments/', $content);
|
$content = str_replace('href="attachments/', 'href="' . $site_url . 'attachments/', $content);
|
||||||
$content = stripWithDelimiters($content, '<script', '</script>');
|
$content = stripWithDelimiters($content, '<script', '</script>');
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class GoogleSearchBridge extends BridgeAbstract {
|
||||||
$html = getSimpleHTMLDOM(self::URI
|
$html = getSimpleHTMLDOM(self::URI
|
||||||
. 'search?q='
|
. 'search?q='
|
||||||
. urlencode($this->getInput('q'))
|
. urlencode($this->getInput('q'))
|
||||||
.'&num=100&complete=0&tbs=qdr:y,sbd:1')
|
. '&num=100&complete=0&tbs=qdr:y,sbd:1')
|
||||||
or returnServerError('No results for this query.');
|
or returnServerError('No results for this query.');
|
||||||
|
|
||||||
$emIsRes = $html->find('div[id=ires]', 0);
|
$emIsRes = $html->find('div[id=ires]', 0);
|
||||||
|
|
|
@ -85,7 +85,7 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
$item['content'] = $data[0];
|
$item['content'] = $data[0];
|
||||||
$item['enclosures'] = $data[1];
|
$item['enclosures'] = $data[1];
|
||||||
} else {
|
} else {
|
||||||
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" alt="'. $item['title'] . '" />';
|
$item['content'] = '<img src="' . htmlentities($media->display_url) . '" alt="' . $item['title'] . '" />';
|
||||||
$item['enclosures'] = array($media->display_url);
|
$item['enclosures'] = array($media->display_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,12 +108,12 @@ class InstagramBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
$enclosures = [$mediaInfo->display_url];
|
$enclosures = [$mediaInfo->display_url];
|
||||||
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="'. $caption . '" />';
|
$content = '<img src="' . htmlentities($mediaInfo->display_url) . '" alt="' . $caption . '" />';
|
||||||
|
|
||||||
foreach($mediaInfo->edge_sidecar_to_children->edges as $media) {
|
foreach($mediaInfo->edge_sidecar_to_children->edges as $media) {
|
||||||
$display_url = $media->node->display_url;
|
$display_url = $media->node->display_url;
|
||||||
if(!in_array($display_url, $enclosures)) { // add only if not added yet
|
if(!in_array($display_url, $enclosures)) { // add only if not added yet
|
||||||
$content .= '<img src="' . htmlentities($display_url) . '" alt="'. $caption . '" />';
|
$content .= '<img src="' . htmlentities($display_url) . '" alt="' . $caption . '" />';
|
||||||
$enclosures[] = $display_url;
|
$enclosures[] = $display_url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class LWNprevBridge extends BridgeAbstract{
|
||||||
private $editionTimeStamp;
|
private $editionTimeStamp;
|
||||||
|
|
||||||
function getURI(){
|
function getURI(){
|
||||||
return self::URI.'free/bigpage';
|
return self::URI . 'free/bigpage';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function jumpToNextTag(&$node){
|
private function jumpToNextTag(&$node){
|
||||||
|
@ -47,7 +47,7 @@ class LWNprevBridge extends BridgeAbstract{
|
||||||
<html><head><title>LWN</title></head><body>{$content}</body></html>
|
<html><head><title>LWN</title></head><body>{$content}</body></html>
|
||||||
EOD;
|
EOD;
|
||||||
} else {
|
} else {
|
||||||
$content = $content.'</body></html>';
|
$content = $content . '</body></html>';
|
||||||
}
|
}
|
||||||
|
|
||||||
libxml_use_internal_errors(true);
|
libxml_use_internal_errors(true);
|
||||||
|
@ -172,7 +172,7 @@ EOD;
|
||||||
|
|
||||||
$prefix = '';
|
$prefix = '';
|
||||||
if(!empty($cats[0])) {
|
if(!empty($cats[0])) {
|
||||||
$prefix .= '['.$cats[0].($cats[1] ? '/'.$cats[1] : '').'] ';
|
$prefix .= '[' . $cats[0] . ($cats[1] ? '/' . $cats[1] : '') . '] ';
|
||||||
}
|
}
|
||||||
return $prefix;
|
return $prefix;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ EOD;
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
|
|
||||||
$item['uri'] = self::URI.'#'.count($items);
|
$item['uri'] = self::URI . '#' . count($items);
|
||||||
|
|
||||||
$item['timestamp'] = $this->editionTimeStamp;
|
$item['timestamp'] = $this->editionTimeStamp;
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ EOD;
|
||||||
$cat = $newsletters->previousSibling;
|
$cat = $newsletters->previousSibling;
|
||||||
$this->jumpToPreviousTag($cat);
|
$this->jumpToPreviousTag($cat);
|
||||||
$prefix = $this->getItemPrefix($cat, $cats);
|
$prefix = $this->getItemPrefix($cat, $cats);
|
||||||
$item['title'] = $prefix.' '.$newsletters->textContent;
|
$item['title'] = $prefix . ' ' . $newsletters->textContent;
|
||||||
|
|
||||||
$node = $newsletters;
|
$node = $newsletters;
|
||||||
$content = '';
|
$content = '';
|
||||||
|
@ -233,7 +233,7 @@ EOD;
|
||||||
$cat = $cat->previousSibling;
|
$cat = $cat->previousSibling;
|
||||||
$this->jumpToPreviousTag($cat);
|
$this->jumpToPreviousTag($cat);
|
||||||
$prefix = $this->getItemPrefix($cat, $cats);
|
$prefix = $this->getItemPrefix($cat, $cats);
|
||||||
$item['title'] = $prefix.' '.$title->textContent;
|
$item['title'] = $prefix . ' ' . $title->textContent;
|
||||||
$items[] = array_merge($item, $this->getArticleContent($title));
|
$items[] = array_merge($item, $this->getArticleContent($title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ EOD;
|
||||||
$cat = $cat->previousSibling;
|
$cat = $cat->previousSibling;
|
||||||
$this->jumpToPreviousTag($cat);
|
$this->jumpToPreviousTag($cat);
|
||||||
$prefix = $this->getItemPrefix($cat, $cats);
|
$prefix = $this->getItemPrefix($cat, $cats);
|
||||||
$item['title'] = $prefix.' '.$title->textContent;
|
$item['title'] = $prefix . ' ' . $title->textContent;
|
||||||
$items[] = array_merge($item, $this->getArticleContent($title));
|
$items[] = array_merge($item, $this->getArticleContent($title));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
$cursor = 'c=10';
|
$cursor = 'c=10';
|
||||||
$posts = array();
|
$posts = array();
|
||||||
for ($i = 0; $i < $this->getPages(); ++$i) {
|
for ($i = 0; $i < $this->getPages(); ++$i) {
|
||||||
$content = getContents($url.$cursor);
|
$content = getContents($url . $cursor);
|
||||||
$json = json_decode($content, true);
|
$json = json_decode($content, true);
|
||||||
$posts = array_merge($posts, $json['data']['posts']);
|
$posts = array_merge($posts, $json['data']['posts']);
|
||||||
$cursor = $json['data']['nextCursor'];
|
$cursor = $json['data']['nextCursor'];
|
||||||
|
@ -156,7 +156,7 @@ class NineGagBridge extends BridgeAbstract {
|
||||||
$uri = $this->getInput('t');
|
$uri = $this->getInput('t');
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::URI.$uri;
|
return self::URI . $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getGroup() {
|
protected function getGroup() {
|
||||||
|
|
|
@ -75,7 +75,7 @@ class PikabuBridge extends BridgeAbstract {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$img->outertext = '<img src="'.$src.'">';
|
$img->outertext = '<img src="' . $src . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
$categories = array();
|
$categories = array();
|
||||||
|
|
|
@ -18,7 +18,7 @@ class PixivBridge extends BridgeAbstract {
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
|
|
||||||
$html = getContents(static::URI.'search.php?word=' . urlencode($this->getInput('tag')))
|
$html = getContents(static::URI . 'search.php?word=' . urlencode($this->getInput('tag')))
|
||||||
or returnClientError('Unable to query pixiv.net');
|
or returnClientError('Unable to query pixiv.net');
|
||||||
$regex = '/<input type="hidden"id="js-mount-point-search-result-list"data-items="([^"]*)/';
|
$regex = '/<input type="hidden"id="js-mount-point-search-result-list"data-items="([^"]*)/';
|
||||||
$timeRegex = '/img\/([0-9]{4})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\//';
|
$timeRegex = '/img\/([0-9]{4})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\/([0-9]{2})\//';
|
||||||
|
|
|
@ -58,7 +58,7 @@ class RTBFBridge extends BridgeAbstract {
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
if(!is_null($this->getInput('c'))) {
|
if(!is_null($this->getInput('c'))) {
|
||||||
return $this->getInput('c') .' - RTBF Bridge';
|
return $this->getInput('c') . ' - RTBF Bridge';
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::getName();
|
return parent::getName();
|
||||||
|
|
|
@ -27,7 +27,7 @@ class RadioMelodieBridge extends BridgeAbstract {
|
||||||
$item['enclosures'] = array($pictureURL);
|
$item['enclosures'] = array($pictureURL);
|
||||||
$item['uri'] = self::URI . $element->parent()->href;
|
$item['uri'] = self::URI . $element->parent()->href;
|
||||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||||
$item['content'] = $element->find('p', 0)->plaintext . '<br/><img src="'.$pictureURL.'"/>';
|
$item['content'] = $element->find('p', 0)->plaintext . '<br/><img src="' . $pictureURL . '"/>';
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ class SuperSmashBlogBridge extends BridgeAbstract {
|
||||||
|
|
||||||
$video = $article['acf']['link_url'];
|
$video = $article['acf']['link_url'];
|
||||||
if (strlen($video) != 0) {
|
if (strlen($video) != 0) {
|
||||||
$video = str_get_html('<a href="' . $video .'">Youtube video</a>');
|
$video = str_get_html('<a href="' . $video . '">Youtube video</a>');
|
||||||
} else {
|
} else {
|
||||||
$video = '';
|
$video = '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class TebeoBridge extends FeedExpander {
|
||||||
$item['uri'] = $element->find('a', 0)->href;
|
$item['uri'] = $element->find('a', 0)->href;
|
||||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||||
$item['timestamp'] = strtotime($element->find('p.moment-format-day', 0)->plaintext);
|
$item['timestamp'] = strtotime($element->find('p.moment-format-day', 0)->plaintext);
|
||||||
$item['content'] = '<a href="'.$item['uri'].'"><img alt="" src="'.$element->find('img', 0)->src.'"></a>';
|
$item['content'] = '<a href="' . $item['uri'] . '"><img alt="" src="' . $element->find('img', 0)->src . '"></a>';
|
||||||
$this->items[] = $item;
|
$this->items[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,12 @@ class TheYeteeBridge extends BridgeAbstract {
|
||||||
$item['author'] = $author;
|
$item['author'] = $author;
|
||||||
|
|
||||||
$uri = $element->find('div[class=controls] a', 0)->href;
|
$uri = $element->find('div[class=controls] a', 0)->href;
|
||||||
$item['uri'] = static::URI.$uri;
|
$item['uri'] = static::URI . $uri;
|
||||||
|
|
||||||
$content = '<p>'.$element->find('section[class=product-listing-info] p', -1)->plaintext.'</p>';
|
$content = '<p>' . $element->find('section[class=product-listing-info] p', -1)->plaintext . '</p>';
|
||||||
$photos = $element->find('a[class=js-modaal-gallery] img');
|
$photos = $element->find('a[class=js-modaal-gallery] img');
|
||||||
foreach($photos as $photo) {
|
foreach($photos as $photo) {
|
||||||
$content = $content."<br /><img src='$photo->src' />";
|
$content = $content . "<br /><img src='$photo->src' />";
|
||||||
$item['enclosures'][] = $photo->src;
|
$item['enclosures'][] = $photo->src;
|
||||||
}
|
}
|
||||||
$item['content'] = $content;
|
$item['content'] = $content;
|
||||||
|
|
|
@ -55,7 +55,7 @@ class UnsplashBridge extends BridgeAbstract {
|
||||||
$item['uri'] = str_replace(
|
$item['uri'] = str_replace(
|
||||||
array('q=75', 'w=400'),
|
array('q=75', 'w=400'),
|
||||||
array("q=$quality", "w=$width"),
|
array("q=$quality", "w=$width"),
|
||||||
$thumbnail->src).'.jpg'; // '.jpg' only for format hint
|
$thumbnail->src) . '.jpg'; // '.jpg' only for format hint
|
||||||
|
|
||||||
$item['timestamp'] = time();
|
$item['timestamp'] = time();
|
||||||
$item['title'] = $thumbnail->alt;
|
$item['title'] = $thumbnail->alt;
|
||||||
|
|
|
@ -377,7 +377,7 @@ class VkBridge extends BridgeAbstract
|
||||||
);
|
);
|
||||||
$post_videos[] = $video_id;
|
$post_videos[] = $video_id;
|
||||||
} else {
|
} else {
|
||||||
$content_suffix .= '<br>Video: <a href="'.htmlspecialchars($video_link).'">'.$video_title.'</a>';
|
$content_suffix .= '<br>Video: <a href="' . htmlspecialchars($video_link) . '">' . $video_title . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ class VkBridge extends BridgeAbstract
|
||||||
if (isset($result['error'])) return;
|
if (isset($result['error'])) return;
|
||||||
|
|
||||||
foreach($result['response']['items'] as $item) {
|
foreach($result['response']['items'] as $item) {
|
||||||
$video_id = strval($item['owner_id']).'_'.strval($item['id']);
|
$video_id = strval($item['owner_id']) . '_' . strval($item['id']);
|
||||||
$this->videos[$video_id]['url'] = $item['player'];
|
$this->videos[$video_id]['url'] = $item['player'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ class VkBridge extends BridgeAbstract
|
||||||
foreach($item['videos'] as $video_id) {
|
foreach($item['videos'] as $video_id) {
|
||||||
$video_link = $this->videos[$video_id]['url'];
|
$video_link = $this->videos[$video_id]['url'];
|
||||||
$video_title = $this->videos[$video_id]['title'];
|
$video_title = $this->videos[$video_id]['title'];
|
||||||
$item['content'] .= '<br>Video: <a href="'.htmlspecialchars($video_link).'">'.$video_title.'</a>';
|
$item['content'] .= '<br>Video: <a href="' . htmlspecialchars($video_link) . '">' . $video_title . '</a>';
|
||||||
}
|
}
|
||||||
unset($item['videos']);
|
unset($item['videos']);
|
||||||
}
|
}
|
||||||
|
@ -408,6 +408,6 @@ class VkBridge extends BridgeAbstract
|
||||||
{
|
{
|
||||||
$params['v'] = '5.80';
|
$params['v'] = '5.80';
|
||||||
$params['access_token'] = $this->getAccessToken();
|
$params['access_token'] = $this->getAccessToken();
|
||||||
return json_decode( getContents('https://api.vk.com/method/'.$method.'?'.http_build_query($params)), true );
|
return json_decode( getContents('https://api.vk.com/method/' . $method . '?' . http_build_query($params)), true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ZoneTelechargementBridge extends BridgeAbstract {
|
||||||
$hoster = $this->findLinkHoster($element);
|
$hoster = $this->findLinkHoster($element);
|
||||||
|
|
||||||
// Format the link and add the link to the corresponding episode table
|
// Format the link and add the link to the corresponding episode table
|
||||||
$episodes[$epnumber][] = '<a href="' . $element->href . '">'. $hoster . ' - '
|
$episodes[$epnumber][] = '<a href="' . $element->href . '">' . $hoster . ' - '
|
||||||
. $this->showTitle . ' Episode ' . $epnumber . '</a>';
|
. $this->showTitle . ' Episode ' . $epnumber . '</a>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class AtomFormat extends FormatAbstract{
|
||||||
if(!empty($extraInfos['icon'])) {
|
if(!empty($extraInfos['icon'])) {
|
||||||
$icon = $extraInfos['icon'];
|
$icon = $extraInfos['icon'];
|
||||||
} else {
|
} else {
|
||||||
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] .'/favicon.ico');
|
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] . '/favicon.ico');
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = $this->xml_encode($uri);
|
$uri = $this->xml_encode($uri);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class MrssFormat extends FormatAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
$uriparts = parse_url($uri);
|
$uriparts = parse_url($uri);
|
||||||
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] .'/favicon.ico');
|
$icon = $this->xml_encode($uriparts['scheme'] . '://' . $uriparts['host'] . '/favicon.ico');
|
||||||
|
|
||||||
$items = '';
|
$items = '';
|
||||||
foreach($this->getItems() as $item) {
|
foreach($this->getItems() as $item) {
|
||||||
|
@ -56,7 +56,7 @@ Some media files might not be shown to you. Consider using the ATOM format inste
|
||||||
|
|
||||||
foreach($item['categories'] as $category) {
|
foreach($item['categories'] as $category) {
|
||||||
$entryCategories .= '<category>'
|
$entryCategories .= '<category>'
|
||||||
. $category . '</category>'
|
. $category . '</category>'
|
||||||
. PHP_EOL;
|
. PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,8 +155,8 @@ function markdownToHtml($string) {
|
||||||
$string = preg_replace('/_(.*)_/U', '<i>$1</i>', $string);
|
$string = preg_replace('/_(.*)_/U', '<i>$1</i>', $string);
|
||||||
$string = preg_replace('/[-]{6,99}/', '<hr />', $string);
|
$string = preg_replace('/[-]{6,99}/', '<hr />', $string);
|
||||||
$string = str_replace(' ', '<br />', $string);
|
$string = str_replace(' ', '<br />', $string);
|
||||||
$string = preg_replace('/([^"])(https?:\/\/[^ "<]+)([^"])/', '$1<a href="$2">$2</a>$3', $string.' ');
|
$string = preg_replace('/([^"])(https?:\/\/[^ "<]+)([^"])/', '$1<a href="$2">$2</a>$3', $string . ' ');
|
||||||
$string = preg_replace('/([^"\/])(www\.[^ "<]+)([^"])/', '$1<a href="http://$2">$2</a>$3', $string.' ');
|
$string = preg_replace('/([^"\/])(www\.[^ "<]+)([^"])/', '$1<a href="http://$2">$2</a>$3', $string . ' ');
|
||||||
|
|
||||||
//As the regex are not perfect, we need to fix <i> and </i> that are introduced in URLs
|
//As the regex are not perfect, we need to fix <i> and </i> that are introduced in URLs
|
||||||
// Fixup regex <i>: https://regex101.com/r/NTRPf6/1
|
// Fixup regex <i>: https://regex101.com/r/NTRPf6/1
|
||||||
|
|
Loading…
Reference in a new issue