From 0a897805ac28ac3be9fd2bb18664edb0cbbe840d Mon Sep 17 00:00:00 2001 From: Jez Nicholson Date: Fri, 1 Mar 2019 08:11:52 +0000 Subject: [PATCH] use :council_reference --- lib/uk_planning_scraper/authorities.csv | 2 ++ lib/uk_planning_scraper/authority_scrape_params.rb | 4 ++-- lib/uk_planning_scraper/idox.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/uk_planning_scraper/authorities.csv b/lib/uk_planning_scraper/authorities.csv index cebfc78..307845f 100644 --- a/lib/uk_planning_scraper/authorities.csv +++ b/lib/uk_planning_scraper/authorities.csv @@ -29,6 +29,7 @@ Camden,http://planningrecords.camden.gov.uk/Northgate/PlanningExplorer17/General Cardiff,https://planningonline.cardiff.gov.uk/online-applications/search.do?action=advanced,wales Cheshire West and Chester,https://pa.cheshirewestandchester.gov.uk/online-applications/search.do?action=advanced,chester cheshire england City of London,http://www.planning2.cityoflondon.gov.uk/online-applications/search.do?action=advanced,london innerlondon northlondon england +Cornwall,http://planning.cornwall.gov.uk/online-applications/search.do?action=advanced,england Croydon,http://publicaccess2.croydon.gov.uk/online-applications/search.do?action=advanced,londonboroughs london Cornwall,http://planning.cornwall.gov.uk/online-applications/search.do?action=advanced,england County Durham,https://publicaccess.durham.gov.uk/online-applications/search.do?action=advanced,england @@ -38,6 +39,7 @@ Doncaster,https://planning.doncaster.gov.uk/online-applications/search.do?action Dumfries and Galloway,https://eaccess.dumgal.gov.uk/online-applications/search.do?action=advanced,scotland Ealing,https://pam.ealing.gov.uk/online-applications/search.do?action=advanced,londonboroughs london East Riding of Yorkshire,https://newplanningaccess.eastriding.gov.uk/newplanningaccess/search.do?action=advanced,england +East Lothian,https://pa.eastlothian.gov.uk/online-applications/search.do?action=advanced,scotland Edinburgh,https://citydev-portal.edinburgh.gov.uk/idoxpa-web/search.do?action=advanced,scotland Enfield,https://planningandbuildingcontrol.enfield.gov.uk/online-applications/search.do?action=advanced,londonboroughs london Epsom and Ewell,http://eplanning.epsom-ewell.gov.uk/online-applications/search.do?action=advanced,surrey england diff --git a/lib/uk_planning_scraper/authority_scrape_params.rb b/lib/uk_planning_scraper/authority_scrape_params.rb index 6ca27d6..df69ec9 100644 --- a/lib/uk_planning_scraper/authority_scrape_params.rb +++ b/lib/uk_planning_scraper/authority_scrape_params.rb @@ -51,9 +51,9 @@ module UKPlanningScraper self end - def reference(s) + def council_reference(s) check_class(s, String) - @scrape_params[:reference] = s.strip + @scrape_params[:council_reference] = s.strip self end diff --git a/lib/uk_planning_scraper/idox.rb b/lib/uk_planning_scraper/idox.rb index 0d9ac5e..f010b43 100644 --- a/lib/uk_planning_scraper/idox.rb +++ b/lib/uk_planning_scraper/idox.rb @@ -41,7 +41,7 @@ module UKPlanningScraper form.send(:"date(applicationDecisionStart)", params[:decided_from].strftime(date_format)) if params[:decided_from] form.send(:"date(applicationDecisionEnd)", params[:decided_to].strftime(date_format)) if params[:decided_to] - form.send(:"searchCriteria\.reference", params[:reference]) + form.send(:"searchCriteria\.reference", params[:council_reference]) form.send(:"searchCriteria\.description", params[:keywords]) # Some councils don't have the applicant name on their form, eg Bexley @@ -124,6 +124,7 @@ module UKPlanningScraper if apps == [] && page.search('pa') app = Application.new + app.council_reference = params[:council_reference] if params[:council_reference] parse_summary(app, page) apps << app end # direct hit