mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[CraigslistBridge] Fix notice with nearby results (#2588)
If the search query includes searchNearby=1, nearby results do not have .result-hood to indicate location, instead using .nearby.
This commit is contained in:
parent
8aa091beda
commit
d4707fc119
@ -74,6 +74,7 @@ class CraigslistBridge extends BridgeAbstract {
|
|||||||
foreach($results as $post) {
|
foreach($results as $post) {
|
||||||
|
|
||||||
// Skip "nearby results" banner and results
|
// Skip "nearby results" banner and results
|
||||||
|
// This only appears when searchNearby is not specified
|
||||||
if ($post->tag == 'h4') {
|
if ($post->tag == 'h4') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -86,7 +87,8 @@ class CraigslistBridge extends BridgeAbstract {
|
|||||||
$item['timestamp'] = $post->find('.result-date', 0)->datetime;
|
$item['timestamp'] = $post->find('.result-date', 0)->datetime;
|
||||||
$item['uid'] = $heading->id;
|
$item['uid'] = $heading->id;
|
||||||
$item['content'] = $post->find('.result-price', 0)->plaintext . ' '
|
$item['content'] = $post->find('.result-price', 0)->plaintext . ' '
|
||||||
. $post->find('.result-hood', 0)->plaintext;
|
// Find the location (local and nearby results if searchNearby=1)
|
||||||
|
. $post->find('.result-hood, span.nearby', 0)->plaintext;
|
||||||
|
|
||||||
$images = $post->find('.result-image[data-ids]', 0);
|
$images = $post->find('.result-image[data-ids]', 0);
|
||||||
if (!is_null($images)) {
|
if (!is_null($images)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user