Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
Always save record as planningalerts now does versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed May 1, 2019
1 parent 934a429 commit 6a6ca4e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@
'date_received' => Date.strptime( div.search('div.application-tile-property span.date-number').attr('data-date-number').value.to_s, '%Q' ) + 1
}

if (ScraperWiki.select("* from data where `council_reference`='#{record['council_reference']}'").empty? rescue true)
puts "Saving record " + record['council_reference'] + ", " + record['address']
puts "Saving record " + record['council_reference'] + ", " + record['address']
# puts record
ScraperWiki.save_sqlite(['council_reference'], record)
else
puts "Skipping already saved record " + record['council_reference']
end
ScraperWiki.save_sqlite(['council_reference'], record)
else
puts "error to parse council_reference's address: " + div.search('div')[0].inner_text.split('Application Number: ')[1].strip
end
Expand Down

0 comments on commit 6a6ca4e

Please sign in to comment.