Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianshort committed Jul 12, 2021
1 parent d423154 commit bcd86c9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/uk_planning_scraper/authority.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

module UKPlanningScraper
class Authority
attr_reader :name, :url, :system
# eg "Camden"
attr_reader :name

# URL of the advanced search page
attr_reader :url

# eg "idox", "northgate"
attr_reader :system

@@authorities = []

Expand All @@ -26,7 +33,9 @@ def initialize(name, url)
@system = 'unknownsystem'
end
end


# Scrape this authority's website for applications

def scrape(options = {})
default_options = {
delay: 10,
Expand Down Expand Up @@ -61,6 +70,7 @@ def scrape(options = {})
output # Single point of successful exit
end

# Return a sorted list of tags for this authority
def tags
@tags.sort
end
Expand Down Expand Up @@ -121,6 +131,7 @@ def self.untagged
def self.load
# Don't run this method more than once
return unless @@authorities.empty?

CSV.foreach(File.join(File.dirname(__dir__), 'uk_planning_scraper', \
'authorities.csv'), :headers => true) do |line|
auth = Authority.new(line['authority_name'], line['url'])
Expand Down

0 comments on commit bcd86c9

Please sign in to comment.