A Ruby gem to get planning applications data from UK council websites.
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.

uk_planning_scraper.rb 657 B

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324
  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