Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
[CraigslistBridge] Fix notice with nearby results (RSS-Bridge#2588)
Browse files Browse the repository at this point in the history
If the search query includes searchNearby=1, nearby results do not have
.result-hood to indicate location, instead using .nearby.
  • Loading branch information
yamanq authored and Kwbmm committed Jun 17, 2022
1 parent 4572252 commit 5b44a1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridges/CraigslistBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public function collectData() {
foreach($results as $post) {

// Skip "nearby results" banner and results
// This only appears when searchNearby is not specified
if ($post->tag == 'h4') {
break;
}
Expand All @@ -86,7 +87,8 @@ public function collectData() {
$item['timestamp'] = $post->find('.result-date', 0)->datetime;
$item['uid'] = $heading->id;
$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);
if (!is_null($images)) {
Expand Down

0 comments on commit 5b44a1b

Please sign in to comment.