A Ruby gem to get planning applications data from UK council websites.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

25 righe
657 B

  1. require "uk_planning_scraper/version"
  2. require 'uk_planning_scraper/idox'
  3. require 'mechanize'
  4. require 'time'
  5. require 'logger'
  6. require 'pp'
  7. module UKPlanningScraper
  8. def self.search(search_url, params, options = {})
  9. default_options = {
  10. delay: 10,
  11. }
  12. options = default_options.merge(options) # The user-supplied options override the defaults
  13. # Select which scraper to use based on the URL
  14. if search_url.match(/search.do\?action=advanced/i)
  15. # Idox
  16. return self.scrape_idox(search_url, params, options)
  17. else
  18. # Not supported
  19. raise "Planning system not supported for URL: #{search_url}"
  20. end
  21. end
  22. end