Permalink
Browse files

Account for geocoding failures in the listing generator.

  • Loading branch information...
1 parent 97f2cb3 commit 2eaf83201129b0a28db57128d39da9d767c2da7b @pwnall committed Jul 21, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/listing_populator.rb
@@ -118,6 +118,11 @@ def process_post_page!(url, anchor_text)
listing.location = clean_location location
listing.posted_at = posted_at
listing.title = clean_title page_title
+
+ # NOTE: the geocoder only fails if someone enters a bad query like "asdfgh"
+ # as the exact location in Craigslist; this is usually spammy brokers,
+ # so we'll ignore their listings.
+ return unless listing.lat && listing.lng
listing.save!
end

0 comments on commit 2eaf832

Please sign in to comment.