@@ -106,6 +106,7 @@ keywords("hip gable") | |||||
applicant_name("Mr and Mrs Smith") # Currently Idox only | applicant_name("Mr and Mrs Smith") # Currently Idox only | ||||
application_type("Householder") # Currently Idox only | application_type("Householder") # Currently Idox only | ||||
development_type("") # Currently Idox only | development_type("") # Currently Idox only | ||||
case_officer_code("100000") # Northgate only | |||||
scrape # runs the scraper | scrape # runs the scraper | ||||
``` | ``` | ||||
@@ -70,7 +70,7 @@ module UKPlanningScraper | |||||
def system | def system | ||||
if @url.match(/search\.do\?action=advanced/i) | if @url.match(/search\.do\?action=advanced/i) | ||||
'idox' | 'idox' | ||||
elsif @url.match(/generalsearch\.aspx/i) | |||||
elsif @url.match(/\.aspx/i) | |||||
'northgate' | 'northgate' | ||||
elsif @url.match(/ocellaweb/i) | elsif @url.match(/ocellaweb/i) | ||||
'ocellaweb' | 'ocellaweb' | ||||
@@ -62,6 +62,17 @@ module UKPlanningScraper | |||||
self | self | ||||
end | end | ||||
def case_officer_code(s) | |||||
unless system == 'northgate' | |||||
raise NoMethodError.new("case_officer_code is only implemented for Northgate. \ | |||||
This authority (#{@name}) is #{system.capitalize}.") | |||||
end | |||||
check_class(s, String) | |||||
@scrape_params[:case_officer_code] = s.strip | |||||
self | |||||
end | |||||
def application_type(s) | def application_type(s) | ||||
unless system == 'idox' | unless system == 'idox' | ||||
raise NoMethodError.new("application_type is only implemented for \ | raise NoMethodError.new("application_type is only implemented for \ | ||||
@@ -24,6 +24,7 @@ module UKPlanningScraper | |||||
'csbtnSearch' => 'Search' # required | 'csbtnSearch' => 'Search' # required | ||||
} | } | ||||
# Keywords | |||||
form_vars['txtProposal'] = params[:keywords] | form_vars['txtProposal'] = params[:keywords] | ||||
# Date received from and to | # Date received from and to | ||||
@@ -50,6 +51,12 @@ module UKPlanningScraper | |||||
form_vars['dateEnd'] = params[:decided_to].to_s if params[:decided_to] # YYYY-MM-DD | form_vars['dateEnd'] = params[:decided_to].to_s if params[:decided_to] # YYYY-MM-DD | ||||
end | end | ||||
# Case officer code | |||||
if params[:case_officer_code] | |||||
form_vars['cboCaseOfficerCode'] = params[:case_officer_code] | |||||
@url.sub!('GeneralSearch.aspx', 'CaseOfficerWorkloadSearch.aspx') | |||||
end | |||||
logger.info "Form variables: #{form_vars.to_s}" | logger.info "Form variables: #{form_vars.to_s}" | ||||
headers = { | headers = { | ||||