mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-08 01:26:31 +02:00
[PepperBridgeAbstract,DealabsBridge,HotUKDealsBridge,MydealsBridge] Fix search URL, No results handling fixed, Thread title and Message URL handling (#4053)
* [PepperBridgeAbstract,DealabsBridge,HotUKDealsBridge,MydealsBridge] Fix search URL, No results handling fixed, Thread title and Message URL handling Search URL has been updated according to the website. If a search doesn't return any results, the HTML won't contain any specific text now : the HTML structure is slightly different, so the bridge has been updated. The unnneded 'no-results' text is now removed from the specific bridges. The board thread title has been removed from the content, so now we use the page <title> element. In case a board message is empty, there was an exception during the filtering of message without URL. * [PepperBridgeAbstract,DealabsBridge,HotUKDealsBridge,MydealsBridge] Fix search URL, No results handling fixed, Thread title and Message URL handling Coding policy fixes
This commit is contained in:
@@ -55,8 +55,8 @@ class PepperBridgeAbstract extends BridgeAbstract
|
||||
);
|
||||
|
||||
// If there is no results, we don't parse the content because it display some random deals
|
||||
$noresult = $html->find('h3[class*=text--b]', 0);
|
||||
if ($noresult != null && strpos($noresult->plaintext, $this->i8n('no-results')) !== false) {
|
||||
$noresult = $html->find('section[class=subNav]', 0)->find('div[class*=page-center listLayout aGrid]', 0);
|
||||
if ($noresult === null) {
|
||||
$this->items = [];
|
||||
} else {
|
||||
foreach ($list as $deal) {
|
||||
@@ -174,13 +174,16 @@ HEREDOC;
|
||||
$item['uid'] = $comment->commentId;
|
||||
// Timestamp handling needs a new parsing function
|
||||
if ($onlyWithUrl == true) {
|
||||
// Count Links and Quote Links
|
||||
$content = str_get_html($item['content']);
|
||||
$countLinks = count($content->find('a[href]'));
|
||||
$countQuoteLinks = count($content->find('a[href][class=userHtml-quote-source]'));
|
||||
// Only add element if there are Links ans more links tant Quote links
|
||||
if ($countLinks > 0 && $countLinks > $countQuoteLinks) {
|
||||
$this->items[] = $item;
|
||||
// Only parse the comment if it is not empry
|
||||
if ($item['content'] != '') {
|
||||
// Count Links and Quote Links
|
||||
$content = str_get_html($item['content']);
|
||||
$countLinks = count($content->find('a[href]'));
|
||||
$countQuoteLinks = count($content->find('a[href][class=userHtml-quote-source]'));
|
||||
// Only add element if there are Links and more links tant Quote links
|
||||
if ($countLinks > 0 && $countLinks > $countQuoteLinks) {
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->items[] = $item;
|
||||
@@ -264,7 +267,7 @@ HEREDOC;
|
||||
private function getTalkTitle()
|
||||
{
|
||||
$html = getSimpleHTMLDOMCached($this->getInput('url'));
|
||||
$title = $html->find('.thread-title', 0)->plaintext;
|
||||
$title = $html->find('title', 0)->plaintext;
|
||||
return $title;
|
||||
}
|
||||
|
||||
@@ -472,7 +475,7 @@ HEREDOC;
|
||||
$priceFrom = $this->getInput('priceFrom');
|
||||
$priceTo = $this->getInput('priceTo');
|
||||
$url = $this->i8n('bridge-uri')
|
||||
. 'search/advanced?q='
|
||||
. 'search?q='
|
||||
. urlencode($q)
|
||||
. '&hide_expired=' . $hide_expired
|
||||
. '&hide_local=' . $hide_local
|
||||
|
Reference in New Issue
Block a user