Planning applications from all 35 London local planning authorities
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
593 B

  1. require 'uk_planning_scraper'
  2. require 'scraperwiki'
  3. auths = UKPlanningScraper::Authority.tagged('london')
  4. params = %w(validated_days decided_days)
  5. auths.each_with_index do |auth, i|
  6. params.each_with_index do |param, j|
  7. puts "Authority #{i + 1} of #{auths.size}: Scrape #{j + 1} of #{params.size} for #{auth.name}."
  8. begin
  9. apps = auth.send(param, ENV['MORPH_DAYS'].to_i).scrape
  10. ScraperWiki.save_sqlite([:authority_name, :council_reference], apps)
  11. puts "#{auth.name}: #{apps.size} application(s) saved."
  12. rescue StandardError => e
  13. puts e
  14. end
  15. end
  16. end