Scrapes planning applications data for InLinkUK from BT kiosks.
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.

17 lines
601 B

  1. require 'uk_planning_scraper'
  2. require 'scraperwiki'
  3. auths = UKPlanningScraper::Authority.all
  4. auths.each_with_index do |auth, i|
  5. next if auth.name == 'Bolton' # https://github.com/adrianshort/uk_planning_scraper/issues/7
  6. puts "#{i + 1} of #{auths.size}: #{auth.name}"
  7. begin
  8. apps = auth.scrape({ validated_days: ENV['MORPH_DAYS'].to_i, keywords: 'inlink'})
  9. ScraperWiki.save_sqlite([:authority_name, :council_reference], apps, 'applications')
  10. puts "#{auth.name}: #{apps.size} application(s) saved."
  11. rescue UKPlanningScraper::SystemNotSupported => e
  12. puts "Error: #{e}"
  13. end
  14. end