Scrapes planning applications data for InLinkUK from BT kiosks.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 6 gadiem
pirms 6 gadiem
pirms 6 gadiem
pirms 6 gadiem
12345678910111213141516171819
  1. require 'uk_planning_scraper'
  2. require 'scraperwiki'
  3. auths = UKPlanningScraper::Authority.all
  4. auths.each_with_index do |auth, i|
  5. puts "#{i + 1} of #{auths.size}: #{auth.name}"
  6. begin
  7. apps = auth.scrape({ validated_days: ENV['MORPH_DAYS'].to_i, keywords: 'inlink'})
  8. apps.each do |app|
  9. unless app[:description].match(/chainlink/i) # Backend keyword search is weak
  10. ScraperWiki.save_sqlite([:authority_name, :council_reference], app, 'applications')
  11. end
  12. end
  13. puts "#{auth.name}: #{apps.size} application(s) saved."
  14. rescue StandardError => e
  15. puts "Error: #{e}"
  16. end
  17. end