Skip to content

Commit

Permalink
Account for geocoding failures in the listing generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall committed Jul 21, 2010
1 parent 97f2cb3 commit 2eaf832
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/listing_populator.rb
Expand Up @@ -118,6 +118,11 @@ def process_post_page!(url, anchor_text)
listing.location = clean_location location listing.location = clean_location location
listing.posted_at = posted_at listing.posted_at = posted_at
listing.title = clean_title page_title 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! listing.save!
end end


Expand Down

0 comments on commit 2eaf832

Please sign in to comment.