diff --git a/cgi-bin/AcolnetParser.py b/cgi-bin/AcolnetParser.py index a6ab243..a700188 100644 --- a/cgi-bin/AcolnetParser.py +++ b/cgi-bin/AcolnetParser.py @@ -4,6 +4,11 @@ import urllib, urllib2 import HTMLParser #from BeautifulSoup import BeautifulSoup +# Adding this to try to help Surrey Heath - Duncan 14/9/2007 +import cookielib +cookie_jar = cookielib.CookieJar() +################ + import urlparse import re @@ -154,9 +159,20 @@ class AcolnetParser(HTMLParser.HTMLParser): elif tag == "td": self._in_td = False + + def _getSearchResponse(self): + # It looks like we sometimes need to do some stuff to get around a + # javascript redirect and cookies. + search_form_request = urllib2.Request(self.base_url) + search_form_response = urllib2.urlopen(search_form_request) + + return search_form_response + + def getResultsByDayMonthYear(self, day, month, year): # first we fetch the search page to get ourselves some session info... - search_form_response = urllib2.urlopen(self.base_url) + search_form_response = self._getSearchResponse() + search_form_contents = search_form_response.read() #outfile = open("tmpfile", "w") @@ -418,16 +434,50 @@ class SuffolkCoastalParser(AcolnetParser): comments_email_address = "d.c.admin@suffolkcoastal.gov.uk" class SurreyHeathParser(AcolnetParser): + # This is not working yet. + # _getSearchResponse is an attempt to work around + # cookies and a javascript redirect. + # I may have a bit more of a go at this at some point if I have time. case_number_tr = 1 # this one can be got by the td class attribute reg_date_tr = 2 location_tr = 4 proposal_tr = 5 comments_email_address = "development-control@surreyheath.gov.uk" + + def _getSearchResponse(self): + # It looks like we sometimes need to do some stuff to get around a + # javascript redirect and cookies. + search_form_request = urllib2.Request(self.base_url) + + # Lying about the user-agent doesn't seem to help. + #search_form_request.add_header("user-agent", "Mozilla/5.0 (compatible; Konqu...L/3.5.6 (like Gecko) (Kubuntu)") + + search_form_response = urllib2.urlopen(search_form_request) + + cookie_jar.extract_cookies(search_form_response, search_form_request) + + + print search_form_response.geturl() + print search_form_response.info() + + print search_form_response.read() +# validate_url = "https://www.public.surreyheath-online.gov.uk/whalecom7cace3215643e22bb7b0b8cc97a7/whalecom0/InternalSite/Validate.asp" +# javascript_redirect_url = urlparse.urljoin(self.base_url, "/whalecom7cace3215643e22bb7b0b8cc97a7/whalecom0/InternalSite/RedirectToOrigURL.asp?site_name=public&secure=1") + +# javascript_redirect_request = urllib2.Request(javascript_redirect_url) +# javascript_redirect_request.add_header('Referer', validate_url) + +# cookie_jar.add_cookie_header(javascript_redirect_request) + +# javascript_redirect_response = urllib2.urlopen(javascript_redirect_request) + +# return javascript_redirect_response + if __name__ == '__main__': - day = 15 - month = 3 + day = 31 + month = 8 year = 2007 # returns error 400 - bad request @@ -440,6 +490,6 @@ if __name__ == '__main__': # results as columns of one table parser = SurreyHeathParser("Surrey Heath", "Surrey Heath", "https://www.public.surreyheath-online.gov.uk/whalecom60b1ef305f59f921/whalecom0/Scripts/PlanningPagesOnline/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch") - + print parser.getResults(day, month, year) diff --git a/cgi-bin/Allerdale.cgi b/cgi-bin/Allerdale.cgi index a5fd1be..8305e56 100644 --- a/cgi-bin/Allerdale.cgi +++ b/cgi-bin/Allerdale.cgi @@ -18,12 +18,16 @@ authority_name = "Allerdale Borough Council" authority_short_name = "Allerdale" base_url = "http://planning.allerdale.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.AllerdaleSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Alnwick.cgi b/cgi-bin/Alnwick.cgi index 3a0284e..7ce11b6 100644 --- a/cgi-bin/Alnwick.cgi +++ b/cgi-bin/Alnwick.cgi @@ -18,12 +18,16 @@ authority_name = "Alnwick District Council" authority_short_name = "Alnwick" base_url = "http://services.castlemorpeth.gov.uk:7777/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.AlnwickSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Angus.cgi b/cgi-bin/Angus.cgi index 0f6cb25..dd1da6d 100644 --- a/cgi-bin/Angus.cgi +++ b/cgi-bin/Angus.cgi @@ -18,12 +18,16 @@ authority_name = "Angus Council" authority_short_name = "Angus" base_url = "http://planning.angus.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Aylesbury Vale.cgi b/cgi-bin/Aylesbury Vale.cgi index fae0a61..8396d47 100644 --- a/cgi-bin/Aylesbury Vale.cgi +++ b/cgi-bin/Aylesbury Vale.cgi @@ -18,12 +18,16 @@ authority_name = "Aylesbury Vale District Council" authority_short_name = "Aylesbury Vale" base_url = "http://eplanning.aylesburyvaledc.gov.uk/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Babergh.cgi b/cgi-bin/Babergh.cgi index 28ecb9e..1bbddfe 100644 --- a/cgi-bin/Babergh.cgi +++ b/cgi-bin/Babergh.cgi @@ -18,12 +18,16 @@ authority_name = "Babergh District Council" authority_short_name = "Babergh" base_url = "http://planning.babergh.gov.uk/dataOnlinePlanning/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.BaberghParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Barrow.cgi b/cgi-bin/Barrow.cgi index c8232c5..07d07a7 100644 --- a/cgi-bin/Barrow.cgi +++ b/cgi-bin/Barrow.cgi @@ -18,12 +18,16 @@ authority_name = "Barrow Borough Council" authority_short_name = "Barrow" base_url = "http://localportal.barrowbc.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.BarrowSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Basildon.cgi b/cgi-bin/Basildon.cgi index 00df2d9..72056b0 100644 --- a/cgi-bin/Basildon.cgi +++ b/cgi-bin/Basildon.cgi @@ -18,12 +18,16 @@ authority_name = "Basildon District Council" authority_short_name = "Basildon" base_url = "http://planning.basildon.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Basingstoke and Deane.cgi b/cgi-bin/Basingstoke and Deane.cgi index d4be3d1..0f22435 100644 --- a/cgi-bin/Basingstoke and Deane.cgi +++ b/cgi-bin/Basingstoke and Deane.cgi @@ -18,12 +18,16 @@ authority_name = "Basingstoke and Deane Borough Council" authority_short_name = "Basingstoke and Deane" base_url = "http://planning.basingstoke.gov.uk/DCOnline2/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.BasingstokeParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bassetlaw.cgi b/cgi-bin/Bassetlaw.cgi index 409f7a8..ccb8a15 100644 --- a/cgi-bin/Bassetlaw.cgi +++ b/cgi-bin/Bassetlaw.cgi @@ -18,12 +18,16 @@ authority_name = "Bassetlaw District Council" authority_short_name = "Bassetlaw" base_url = "http://www.bassetlaw.gov.uk/planning/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.BassetlawParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bath.cgi b/cgi-bin/Bath.cgi index c68eff9..befad60 100644 --- a/cgi-bin/Bath.cgi +++ b/cgi-bin/Bath.cgi @@ -18,12 +18,16 @@ authority_name = "Bath and North East Somerset" authority_short_name = "Bath" base_url = "http://planning.bathnes.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bexley.cgi b/cgi-bin/Bexley.cgi index 304d19b..5d3dceb 100644 --- a/cgi-bin/Bexley.cgi +++ b/cgi-bin/Bexley.cgi @@ -18,12 +18,16 @@ authority_name = "Bexley Council" authority_short_name = "Bexley" base_url = "http://publicaccess.bexley.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Blaby.cgi b/cgi-bin/Blaby.cgi index 0d66595..a2db43e 100644 --- a/cgi-bin/Blaby.cgi +++ b/cgi-bin/Blaby.cgi @@ -18,12 +18,16 @@ authority_name = "Blaby District Council" authority_short_name = "Blaby" base_url = "http://www.blaby.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bolsover.cgi b/cgi-bin/Bolsover.cgi index 3fe75fd..27e4e61 100644 --- a/cgi-bin/Bolsover.cgi +++ b/cgi-bin/Bolsover.cgi @@ -18,12 +18,16 @@ authority_name = "Bolsover District Council" authority_short_name = "Bolsover" base_url = "http://217.158.161.181/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bracknell Forest.cgi b/cgi-bin/Bracknell Forest.cgi index 197754a..141a7a2 100755 --- a/cgi-bin/Bracknell Forest.cgi +++ b/cgi-bin/Bracknell Forest.cgi @@ -18,12 +18,16 @@ authority_name = "Bracknell Forest Borough Council" authority_short_name = "Bracknell Forest" base_url = "https://my.bracknell-forest.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bridgnorth.cgi b/cgi-bin/Bridgnorth.cgi index 95f1734..cd7847f 100755 --- a/cgi-bin/Bridgnorth.cgi +++ b/cgi-bin/Bridgnorth.cgi @@ -18,12 +18,16 @@ authority_name = "Bridgnorth District Council" authority_short_name = "Bridgnorth" base_url = "http://www2.bridgnorth-dc.gov.uk/planning/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.BridgnorthParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bristol.cgi b/cgi-bin/Bristol.cgi index 3b29e13..0ce8341 100644 --- a/cgi-bin/Bristol.cgi +++ b/cgi-bin/Bristol.cgi @@ -18,12 +18,16 @@ authority_name = "Bristol City Council" authority_short_name = "Bristol" base_url = "http://e2eweb.bristol-city.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Broads.cgi b/cgi-bin/Broads.cgi index fabe99d..f3f0925 100755 --- a/cgi-bin/Broads.cgi +++ b/cgi-bin/Broads.cgi @@ -18,12 +18,16 @@ authority_name = "Broads Authority" authority_short_name = "Broads" base_url = "https://planning.broads-authority.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bromley.cgi b/cgi-bin/Bromley.cgi index c0407ca..8408d9f 100755 --- a/cgi-bin/Bromley.cgi +++ b/cgi-bin/Bromley.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough of Bromley" authority_short_name = "Bromley" base_url = "http://planningaccess.bromley.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Buckinghamshire.cgi b/cgi-bin/Buckinghamshire.cgi index 3d50799..0ced796 100644 --- a/cgi-bin/Buckinghamshire.cgi +++ b/cgi-bin/Buckinghamshire.cgi @@ -18,12 +18,16 @@ authority_name = "Buckinghamshire County Council" authority_short_name = "Buckinghamshire" base_url = "http://www.bucksplanning.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Bury.cgi b/cgi-bin/Bury.cgi index f6454f3..5e26c0c 100644 --- a/cgi-bin/Bury.cgi +++ b/cgi-bin/Bury.cgi @@ -18,12 +18,16 @@ authority_name = "Bury Metropolitan Borough Council" authority_short_name = "Bury" base_url = "http://e-planning.bury.gov.uk/ePlanning/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.BuryParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Caradon.cgi b/cgi-bin/Caradon.cgi index 57fee8b..38d3ddc 100755 --- a/cgi-bin/Caradon.cgi +++ b/cgi-bin/Caradon.cgi @@ -18,12 +18,16 @@ authority_name = "Caradon District Council" authority_short_name = "Caradon" base_url = "http://publicaccess.caradon.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Carlisle.cgi b/cgi-bin/Carlisle.cgi index 5c9b09f..932065f 100755 --- a/cgi-bin/Carlisle.cgi +++ b/cgi-bin/Carlisle.cgi @@ -18,12 +18,16 @@ authority_name = "Carlisle City Council" authority_short_name = "Carlisle" base_url = "http://planning.carlisle.gov.uk/acolnet/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.CarlisleParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Chelmsford.cgi b/cgi-bin/Chelmsford.cgi index 4bd1472..9bde9f6 100644 --- a/cgi-bin/Chelmsford.cgi +++ b/cgi-bin/Chelmsford.cgi @@ -18,12 +18,16 @@ authority_name = "Chelmsford Borough Council" authority_short_name = "Chelmsford" base_url = "http://web1.chelmsfordbc.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Cherwell.cgi b/cgi-bin/Cherwell.cgi index ac916e7..7ee56aa 100644 --- a/cgi-bin/Cherwell.cgi +++ b/cgi-bin/Cherwell.cgi @@ -18,12 +18,16 @@ authority_name = "Cherwell District Council" authority_short_name = "Cherwell" base_url = "http://cherweb.cherwell-dc.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Chiltern.cgi b/cgi-bin/Chiltern.cgi index 44b1ce9..c4dc480 100755 --- a/cgi-bin/Chiltern.cgi +++ b/cgi-bin/Chiltern.cgi @@ -18,12 +18,16 @@ authority_name = "Chiltern District Council" authority_short_name = "Chiltern" base_url = "https://isa.chiltern.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Chorley.cgi b/cgi-bin/Chorley.cgi index feb5b96..f590329 100644 --- a/cgi-bin/Chorley.cgi +++ b/cgi-bin/Chorley.cgi @@ -18,12 +18,16 @@ authority_name = "Chorley Borough Council" authority_short_name = "Chorley" base_url = "http://planning.chorley.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/City of London.cgi b/cgi-bin/City of London.cgi index 57a2234..b4b305f 100644 --- a/cgi-bin/City of London.cgi +++ b/cgi-bin/City of London.cgi @@ -18,12 +18,16 @@ authority_name = "City of London" authority_short_name = "City of London" base_url = "http://www.planning.cityoflondon.gov.uk/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Cornwall.cgi b/cgi-bin/Cornwall.cgi index cd5b5a5..ff7801b 100644 --- a/cgi-bin/Cornwall.cgi +++ b/cgi-bin/Cornwall.cgi @@ -18,12 +18,16 @@ authority_name = "Cornwall County Council" authority_short_name = "Cornwall" base_url = "http://planapps.cornwall.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Coventry.cgi b/cgi-bin/Coventry.cgi index 0f8c44b..c9f5413 100644 --- a/cgi-bin/Coventry.cgi +++ b/cgi-bin/Coventry.cgi @@ -18,12 +18,16 @@ authority_name = "Coventry City Council" authority_short_name = "Coventry" base_url = "http://planning.coventry.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.CoventrySearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Craven.cgi b/cgi-bin/Craven.cgi index 7f16621..26cb141 100755 --- a/cgi-bin/Craven.cgi +++ b/cgi-bin/Craven.cgi @@ -18,12 +18,16 @@ authority_name = "Craven District Council" authority_short_name = "Craven" base_url = "http://www.planning.cravendc.gov.uk/fastweb/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Croydon.cgi b/cgi-bin/Croydon.cgi index 3ac9fc2..09ae306 100755 --- a/cgi-bin/Croydon.cgi +++ b/cgi-bin/Croydon.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough of Croydon" authority_short_name = "Croydon" base_url = "http://planning.croydon.gov.uk/DCWebPages/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.CroydonParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Denbighshire.cgi b/cgi-bin/Denbighshire.cgi index 9cef9fd..4e4c6ef 100644 --- a/cgi-bin/Denbighshire.cgi +++ b/cgi-bin/Denbighshire.cgi @@ -18,12 +18,16 @@ authority_name = "Denbighshire County Council" authority_short_name = "Denbighshire" base_url = "http://planning.denbighshire.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.DenbighshireSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Derby.cgi b/cgi-bin/Derby.cgi index 1ae552e..87a439b 100644 --- a/cgi-bin/Derby.cgi +++ b/cgi-bin/Derby.cgi @@ -18,12 +18,16 @@ authority_name = "Derby City Council" authority_short_name = "Derby" base_url = "http://195.224.106.204/scripts/planningpages02%5CXSLPagesDC_DERBY%5CDCWebPages/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.DerbyParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Doncaster.cgi b/cgi-bin/Doncaster.cgi index 564f342..b0a0012 100644 --- a/cgi-bin/Doncaster.cgi +++ b/cgi-bin/Doncaster.cgi @@ -18,12 +18,16 @@ authority_name = "Doncaster Metropolitan Borough Council" authority_short_name = "Doncaster" base_url = "http://maps.doncaster.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Dundee.cgi b/cgi-bin/Dundee.cgi index 04a238b..150db95 100644 --- a/cgi-bin/Dundee.cgi +++ b/cgi-bin/Dundee.cgi @@ -18,12 +18,16 @@ authority_name = "Dundee City Council" authority_short_name = "Dundee" base_url = "http://bwarrant.dundeecity.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Durham.cgi b/cgi-bin/Durham.cgi index 2ca2b5f..f6d6341 100644 --- a/cgi-bin/Durham.cgi +++ b/cgi-bin/Durham.cgi @@ -18,12 +18,16 @@ authority_name = "Durham City Council" authority_short_name = "Durham" base_url = "http://publicaccess.durhamcity.gov.uk/publicaccess/dc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Ealing.cgi b/cgi-bin/Ealing.cgi index 53fb009..a784ff5 100644 --- a/cgi-bin/Ealing.cgi +++ b/cgi-bin/Ealing.cgi @@ -18,12 +18,16 @@ authority_name = "Ealing Council" authority_short_name = "Ealing" base_url = "http://www.pam.ealing.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.EalingSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Easington.cgi b/cgi-bin/Easington.cgi index ef12a77..5932476 100644 --- a/cgi-bin/Easington.cgi +++ b/cgi-bin/Easington.cgi @@ -18,12 +18,16 @@ authority_name = "District of Easington" authority_short_name = "Easington" base_url = "http://planning.easington.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.EasingtonSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/East Devon.cgi b/cgi-bin/East Devon.cgi index 1171e41..45651a4 100644 --- a/cgi-bin/East Devon.cgi +++ b/cgi-bin/East Devon.cgi @@ -18,12 +18,16 @@ authority_name = "East Devon District Council" authority_short_name = "East Devon" base_url = "http://planning.eastdevon.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/East Dorset.cgi b/cgi-bin/East Dorset.cgi index 5266fed..41fdc72 100755 --- a/cgi-bin/East Dorset.cgi +++ b/cgi-bin/East Dorset.cgi @@ -18,12 +18,16 @@ authority_name = "East Dorset District Council" authority_short_name = "East Dorset" base_url = "http://193.243.228.16/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/East Lindsey.cgi b/cgi-bin/East Lindsey.cgi index ef98a62..a34054c 100644 --- a/cgi-bin/East Lindsey.cgi +++ b/cgi-bin/East Lindsey.cgi @@ -18,12 +18,16 @@ authority_name = "East Lindsey District Council" authority_short_name = "East Lindsey" base_url = "http://www.e-lindsey.gov.uk/planning/AcolnetCGI.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.EastLindseyParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Eastleigh.cgi b/cgi-bin/Eastleigh.cgi index f2453c4..6047701 100755 --- a/cgi-bin/Eastleigh.cgi +++ b/cgi-bin/Eastleigh.cgi @@ -18,12 +18,16 @@ authority_name = "Eastleigh Borough Council" authority_short_name = "Eastleigh" base_url = "http://www.eastleigh.gov.uk/FastWEB/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Eden.cgi b/cgi-bin/Eden.cgi index 4c289b9..bdb930e 100755 --- a/cgi-bin/Eden.cgi +++ b/cgi-bin/Eden.cgi @@ -18,12 +18,16 @@ authority_name = "Eden District Council" authority_short_name = "Eden" base_url = "http://eforms.eden.gov.uk/fastweb/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Edinburgh.cgi b/cgi-bin/Edinburgh.cgi index bc94611..2796e49 100644 --- a/cgi-bin/Edinburgh.cgi +++ b/cgi-bin/Edinburgh.cgi @@ -18,12 +18,16 @@ authority_name = "The City of Edinburgh Council" authority_short_name = "Edinburgh" base_url = "http://citydev-portal.edinburgh.gov.uk/publicaccess/dc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Epsom and Ewell.cgi b/cgi-bin/Epsom and Ewell.cgi index 3cf0346..a69174d 100644 --- a/cgi-bin/Epsom and Ewell.cgi +++ b/cgi-bin/Epsom and Ewell.cgi @@ -18,12 +18,16 @@ authority_name = "Epsom and Ewell Borough Council" authority_short_name = "Epsom and Ewell" base_url = "http://eplanning.epsom-ewell.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Fenland.cgi b/cgi-bin/Fenland.cgi index bee5f79..3b60b73 100644 --- a/cgi-bin/Fenland.cgi +++ b/cgi-bin/Fenland.cgi @@ -18,12 +18,16 @@ authority_name = "Fenland District Council" authority_short_name = "Fenland" base_url = "http://www.fenland.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Fylde.cgi b/cgi-bin/Fylde.cgi index 2e81dfe..4048088 100755 --- a/cgi-bin/Fylde.cgi +++ b/cgi-bin/Fylde.cgi @@ -18,12 +18,16 @@ authority_name = "Fylde Borough Council" authority_short_name = "Fylde" base_url = "http://www2.fylde.gov.uk/planning/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.FyldeParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Gateshead.cgi b/cgi-bin/Gateshead.cgi index 9def7d1..4037705 100755 --- a/cgi-bin/Gateshead.cgi +++ b/cgi-bin/Gateshead.cgi @@ -18,12 +18,16 @@ authority_name = "Gateshead Metropolitan Borough Council" authority_short_name = "Gateshead" base_url = "http://planning.gateshead.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Gedling.cgi b/cgi-bin/Gedling.cgi index 0a92dad..c612988 100644 --- a/cgi-bin/Gedling.cgi +++ b/cgi-bin/Gedling.cgi @@ -18,12 +18,16 @@ authority_name = "Gedling Borough Council" authority_short_name = "Gedling" base_url = "http://publicaccess.gedling.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Gloucestershire.cgi b/cgi-bin/Gloucestershire.cgi index bcf649e..d5732c7 100755 --- a/cgi-bin/Gloucestershire.cgi +++ b/cgi-bin/Gloucestershire.cgi @@ -18,12 +18,16 @@ authority_name = "Gloucestershire County Council" authority_short_name = "Gloucestershire" base_url = "http://planning.gloucestershire.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Gravesham.cgi b/cgi-bin/Gravesham.cgi index c84e00d..a576a58 100644 --- a/cgi-bin/Gravesham.cgi +++ b/cgi-bin/Gravesham.cgi @@ -18,12 +18,16 @@ authority_name = "Gravesham Borough Council" authority_short_name = "Gravesham" base_url = "http://195.102.67.4/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hambleton.cgi b/cgi-bin/Hambleton.cgi index b41b085..8221dec 100755 --- a/cgi-bin/Hambleton.cgi +++ b/cgi-bin/Hambleton.cgi @@ -18,12 +18,16 @@ authority_name = "Hambleton District Council" authority_short_name = "Hambleton" base_url = "http://planning.hambleton.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hammersmith and Fulham.cgi b/cgi-bin/Hammersmith and Fulham.cgi index 15d6c49..cce92a9 100644 --- a/cgi-bin/Hammersmith and Fulham.cgi +++ b/cgi-bin/Hammersmith and Fulham.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough Of Hammersmith and Fulham" authority_short_name = "Hammersmith and Fulham" base_url = "http://www.apps.lbhf.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Haringey.cgi b/cgi-bin/Haringey.cgi index 478b564..89fd0a4 100644 --- a/cgi-bin/Haringey.cgi +++ b/cgi-bin/Haringey.cgi @@ -18,12 +18,16 @@ authority_name = "Haringey Council" authority_short_name = "Haringey" base_url = "http://www.planningservices.haringey.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.HaringeySearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Harlow.cgi b/cgi-bin/Harlow.cgi index 8b5357e..db5c0b1 100644 --- a/cgi-bin/Harlow.cgi +++ b/cgi-bin/Harlow.cgi @@ -18,12 +18,16 @@ authority_name = "Harlow Council" authority_short_name = "Harlow" base_url = "http://planning.harlow.gov.uk/PlanningSearch/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.HarlowParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Harrogate.cgi b/cgi-bin/Harrogate.cgi index 9001d50..7cb90d0 100644 --- a/cgi-bin/Harrogate.cgi +++ b/cgi-bin/Harrogate.cgi @@ -18,12 +18,16 @@ authority_name = "Harrogate Borough Council" authority_short_name = "Harrogate" base_url = "http://publicaccess.harrogate.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hart.cgi b/cgi-bin/Hart.cgi index 4a400b2..ca65fc1 100644 --- a/cgi-bin/Hart.cgi +++ b/cgi-bin/Hart.cgi @@ -18,12 +18,16 @@ authority_name = "Hart District Council" authority_short_name = "Hart" base_url = "http://publicaccess.hart.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hartlepool.cgi b/cgi-bin/Hartlepool.cgi index d3771d4..540d96f 100644 --- a/cgi-bin/Hartlepool.cgi +++ b/cgi-bin/Hartlepool.cgi @@ -18,12 +18,16 @@ authority_name = "Hartlepool Borough Council" authority_short_name = "Hartlepool" base_url = "http://eforms.hartlepool.gov.uk:7777/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.HartlepoolSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hertsmere.cgi b/cgi-bin/Hertsmere.cgi index 91b5177..0c0cfb9 100644 --- a/cgi-bin/Hertsmere.cgi +++ b/cgi-bin/Hertsmere.cgi @@ -18,12 +18,16 @@ authority_name = "Hertsmere Borough Council" authority_short_name = "Hertsmere" base_url = "http://www2.hertsmere.gov.uk/ACOLNET/DCOnline//acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.HertsmereParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/High Peak.cgi b/cgi-bin/High Peak.cgi index 91c05f8..4220a8c 100644 --- a/cgi-bin/High Peak.cgi +++ b/cgi-bin/High Peak.cgi @@ -18,12 +18,16 @@ authority_name = "High Peak Borough Council" authority_short_name = "High Peak" base_url = "http://planning.highpeak.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.HighPeakSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Hinkley and Bosworth.cgi b/cgi-bin/Hinkley and Bosworth.cgi index b9be750..751287d 100755 --- a/cgi-bin/Hinkley and Bosworth.cgi +++ b/cgi-bin/Hinkley and Bosworth.cgi @@ -18,12 +18,16 @@ authority_name = "Hinkley and Bosworth Borough Council" authority_short_name = "Hinkley and Bosworth" base_url = "https://cx.hinckley-bosworth.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Huntingdonshire.cgi b/cgi-bin/Huntingdonshire.cgi index f3e1aac..c737902 100644 --- a/cgi-bin/Huntingdonshire.cgi +++ b/cgi-bin/Huntingdonshire.cgi @@ -18,12 +18,16 @@ authority_name = "Huntingdonshire District Council" authority_short_name = "Huntingdonshire" base_url = "http://planning.huntsdc.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Kerrier.cgi b/cgi-bin/Kerrier.cgi index 0099b24..92f587e 100644 --- a/cgi-bin/Kerrier.cgi +++ b/cgi-bin/Kerrier.cgi @@ -18,12 +18,16 @@ authority_name = "Kerrier District Council" authority_short_name = "Kerrier" base_url = "http://publicaccess.kerrier.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Knowsley.cgi b/cgi-bin/Knowsley.cgi index fb4ddef..fcd7375 100644 --- a/cgi-bin/Knowsley.cgi +++ b/cgi-bin/Knowsley.cgi @@ -18,12 +18,16 @@ authority_name = "Knowsley Council" authority_short_name = "Knowsley" base_url = "http://publicaccess.knowsley.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Lancaster.cgi b/cgi-bin/Lancaster.cgi index 545b367..de817d1 100644 --- a/cgi-bin/Lancaster.cgi +++ b/cgi-bin/Lancaster.cgi @@ -18,12 +18,16 @@ authority_name = "Lancaster City Council" authority_short_name = "Lancaster" base_url = "http://planapps.lancaster.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Lewisham.cgi b/cgi-bin/Lewisham.cgi index 4cd6721..baddf8d 100755 --- a/cgi-bin/Lewisham.cgi +++ b/cgi-bin/Lewisham.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough of Lewisham" authority_short_name = "Lewisham" base_url = "http://acolnet.lewisham.gov.uk/lewis-xslpagesdc/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.LewishamParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Luton.cgi b/cgi-bin/Luton.cgi index b209e65..e0d529a 100644 --- a/cgi-bin/Luton.cgi +++ b/cgi-bin/Luton.cgi @@ -18,12 +18,16 @@ authority_name = "Luton Borough Council" authority_short_name = "Luton" base_url = "http://www.eplan.luton.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Malvern Hills.cgi b/cgi-bin/Malvern Hills.cgi index 3d496dd..9292df6 100644 --- a/cgi-bin/Malvern Hills.cgi +++ b/cgi-bin/Malvern Hills.cgi @@ -18,12 +18,16 @@ authority_name = "Malvern Hills District Council" authority_short_name = "Malvern Hills" base_url = "http://public.malvernhills.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Manchester.cgi b/cgi-bin/Manchester.cgi index f013a12..1c3c548 100644 --- a/cgi-bin/Manchester.cgi +++ b/cgi-bin/Manchester.cgi @@ -18,12 +18,16 @@ authority_name = "Manchester City Council" authority_short_name = "Manchester" base_url = "http://www.publicaccess.manchester.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Mansfield.cgi b/cgi-bin/Mansfield.cgi index d9bc0f6..fbb227c 100755 --- a/cgi-bin/Mansfield.cgi +++ b/cgi-bin/Mansfield.cgi @@ -18,12 +18,16 @@ authority_name = "Mansfield District Council" authority_short_name = "Mansfield" base_url = "http://www.mansfield.gov.uk/Fastweb23/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Mid Devon.cgi b/cgi-bin/Mid Devon.cgi index 33ed21c..9d54e5a 100644 --- a/cgi-bin/Mid Devon.cgi +++ b/cgi-bin/Mid Devon.cgi @@ -18,12 +18,16 @@ authority_name = "Mid Devon District Council" authority_short_name = "Mid Devon" base_url = "http://planning.middevon.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Milton Keynes.cgi b/cgi-bin/Milton Keynes.cgi index ea86713..b37904b 100644 --- a/cgi-bin/Milton Keynes.cgi +++ b/cgi-bin/Milton Keynes.cgi @@ -18,12 +18,16 @@ authority_name = "Milton Keynes Council" authority_short_name = "Milton Keynes" base_url = "http://publicaccess.milton-keynes.gov.uk/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Moray.cgi b/cgi-bin/Moray.cgi index e93f74e..4514ab9 100755 --- a/cgi-bin/Moray.cgi +++ b/cgi-bin/Moray.cgi @@ -18,12 +18,16 @@ authority_name = "Moray Council" authority_short_name = "Moray" base_url = "http://public.moray.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/NW Leicestershire.cgi b/cgi-bin/NW Leicestershire.cgi index 9569076..c653c9d 100644 --- a/cgi-bin/NW Leicestershire.cgi +++ b/cgi-bin/NW Leicestershire.cgi @@ -18,12 +18,16 @@ authority_name = "North West Leicestershire District Council" authority_short_name = "NW Leicestershire" base_url = "http://paccess.nwleics.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/New Forest DC.cgi b/cgi-bin/New Forest DC.cgi index 29e555b..43bf326 100755 --- a/cgi-bin/New Forest DC.cgi +++ b/cgi-bin/New Forest DC.cgi @@ -18,12 +18,16 @@ authority_name = "New Forest District Council" authority_short_name = "New Forest DC" base_url = "http://web3.newforest.gov.uk/planningonline/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.NewForestDCParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/New Forest NP.cgi b/cgi-bin/New Forest NP.cgi index 67305fa..f55b029 100755 --- a/cgi-bin/New Forest NP.cgi +++ b/cgi-bin/New Forest NP.cgi @@ -18,12 +18,16 @@ authority_name = "New Forest National Park" authority_short_name = "New Forest NP" base_url = "http://web01.newforestnpa.gov.uk/planningpages/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.NewForestNPParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Newcastle-under-Lyme.cgi b/cgi-bin/Newcastle-under-Lyme.cgi index 2b0bf8d..ff1f8b3 100755 --- a/cgi-bin/Newcastle-under-Lyme.cgi +++ b/cgi-bin/Newcastle-under-Lyme.cgi @@ -18,12 +18,16 @@ authority_name = "Newcastle-under-Lyme Borough Council" authority_short_name = "Newcastle-under-Lyme" base_url = "http://publicaccess.newcastle-staffs.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Newcastle.cgi b/cgi-bin/Newcastle.cgi index a18c331..feb7a42 100644 --- a/cgi-bin/Newcastle.cgi +++ b/cgi-bin/Newcastle.cgi @@ -18,12 +18,16 @@ authority_name = "Newcastle City Council" authority_short_name = "Newcastle" base_url = "http://gispublic.newcastle.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Newham.cgi b/cgi-bin/Newham.cgi index 27114a6..d6c4e87 100644 --- a/cgi-bin/Newham.cgi +++ b/cgi-bin/Newham.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough Of Newham" authority_short_name = "Newham" base_url = "http://pacaps.newham.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/North Hertfordshire.cgi b/cgi-bin/North Hertfordshire.cgi index 2c5a92e..d4e3fbd 100755 --- a/cgi-bin/North Hertfordshire.cgi +++ b/cgi-bin/North Hertfordshire.cgi @@ -18,12 +18,16 @@ authority_name = "North Hertfordshire District Council" authority_short_name = "North Hertfordshire" base_url = "http://www.north-herts.gov.uk/dcdataonline/Pages/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.NorthHertfordshireParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/North Tyneside.cgi b/cgi-bin/North Tyneside.cgi index f6218b7..978b96c 100644 --- a/cgi-bin/North Tyneside.cgi +++ b/cgi-bin/North Tyneside.cgi @@ -18,12 +18,16 @@ authority_name = "North Tyneside Council" authority_short_name = "North Tyneside" base_url = "http://publicaccess.northtyneside.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/North Warwickshire.cgi b/cgi-bin/North Warwickshire.cgi index 9fabe83..2d5d86f 100644 --- a/cgi-bin/North Warwickshire.cgi +++ b/cgi-bin/North Warwickshire.cgi @@ -18,12 +18,16 @@ authority_name = "North Warwickshire Borough Council" authority_short_name = "North Warwickshire" base_url = "http://planning.northwarks.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.NorthWarksSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/North Wiltshire.cgi b/cgi-bin/North Wiltshire.cgi index 4423958..063bd15 100644 --- a/cgi-bin/North Wiltshire.cgi +++ b/cgi-bin/North Wiltshire.cgi @@ -18,12 +18,16 @@ authority_name = "North Wiltshire District Council" authority_short_name = "North Wiltshire" base_url = "http://planning.northwilts.gov.uk/DCOnline/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.NorthWiltshireParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Northumberland.cgi b/cgi-bin/Northumberland.cgi index e8d490e..159ec3b 100644 --- a/cgi-bin/Northumberland.cgi +++ b/cgi-bin/Northumberland.cgi @@ -18,12 +18,16 @@ authority_name = "Northumberland County Council" authority_short_name = "Northumberland" base_url = "http://planning.northumberland.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Oadby and Wigston.cgi b/cgi-bin/Oadby and Wigston.cgi index 719be02..571580f 100644 --- a/cgi-bin/Oadby and Wigston.cgi +++ b/cgi-bin/Oadby and Wigston.cgi @@ -18,12 +18,16 @@ authority_name = "The Borough of Oadby and Wigston" authority_short_name = "Oadby and Wigston" base_url = "http://web.owbc.net/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Oldham.cgi b/cgi-bin/Oldham.cgi index 39926a8..d0e2b79 100755 --- a/cgi-bin/Oldham.cgi +++ b/cgi-bin/Oldham.cgi @@ -18,12 +18,16 @@ authority_name = "Oldham District Council" authority_short_name = "Oldham" base_url = "http://planning.oldham.gov.uk/planning//acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.OldhamParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Oswestry.cgi b/cgi-bin/Oswestry.cgi index dce6990..126e0f4 100644 --- a/cgi-bin/Oswestry.cgi +++ b/cgi-bin/Oswestry.cgi @@ -18,12 +18,16 @@ authority_name = "Oswestry Borough Council" authority_short_name = "Oswestry" base_url = "http://193.114.205.78/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Perthshire.cgi b/cgi-bin/Perthshire.cgi index 79907b8..6171290 100755 --- a/cgi-bin/Perthshire.cgi +++ b/cgi-bin/Perthshire.cgi @@ -18,12 +18,16 @@ authority_name = "Perth and Kinross Council" authority_short_name = "Perthshire" base_url = "http://193.63.61.22/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Peterborough.cgi b/cgi-bin/Peterborough.cgi index 94e4a0a..14387ee 100644 --- a/cgi-bin/Peterborough.cgi +++ b/cgi-bin/Peterborough.cgi @@ -18,12 +18,16 @@ authority_name = "Peterborough City Council" authority_short_name = "Peterborough" base_url = "http://194.72.246.15/publicaccess/dc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Portsmouth.cgi b/cgi-bin/Portsmouth.cgi index 04b1e73..c6d38f3 100644 --- a/cgi-bin/Portsmouth.cgi +++ b/cgi-bin/Portsmouth.cgi @@ -18,12 +18,16 @@ authority_name = "Portsmouth City Council" authority_short_name = "Portsmouth" base_url = "http://planning.portsmouth.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Redditch.cgi b/cgi-bin/Redditch.cgi index 8ce52b2..a69c2a2 100644 --- a/cgi-bin/Redditch.cgi +++ b/cgi-bin/Redditch.cgi @@ -18,12 +18,16 @@ authority_name = "Redditch Borough Council" authority_short_name = "Redditch" base_url = "http://access.redditchbc.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Renfrewshire.cgi b/cgi-bin/Renfrewshire.cgi index bf12fb5..e8ccea4 100644 --- a/cgi-bin/Renfrewshire.cgi +++ b/cgi-bin/Renfrewshire.cgi @@ -18,12 +18,16 @@ authority_name = "Renfrewshire Council" authority_short_name = "Renfrewshire" base_url = "http://planning.renfrewshire.gov.uk/acolnetDCpages/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.RenfrewshireParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Rushmoor.cgi b/cgi-bin/Rushmoor.cgi index 3f64c6d..e91ef2e 100644 --- a/cgi-bin/Rushmoor.cgi +++ b/cgi-bin/Rushmoor.cgi @@ -18,12 +18,16 @@ authority_name = "Rushmoor Borough Council" authority_short_name = "Rushmoor" base_url = "http://pa-dc.rushmoor.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Scarborough.cgi b/cgi-bin/Scarborough.cgi index 267da5e..02abde3 100644 --- a/cgi-bin/Scarborough.cgi +++ b/cgi-bin/Scarborough.cgi @@ -18,12 +18,16 @@ authority_name = "Scarborough Borough Council" authority_short_name = "Scarborough" base_url = "http://planning.scarborough.gov.uk/publicaccess/dc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Selby.cgi b/cgi-bin/Selby.cgi index ac6e25d..bb6bdac 100755 --- a/cgi-bin/Selby.cgi +++ b/cgi-bin/Selby.cgi @@ -18,12 +18,16 @@ authority_name = "Selby District Council" authority_short_name = "Selby" base_url = "http://publicaccess.selby.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Sevenoaks.cgi b/cgi-bin/Sevenoaks.cgi index 44169f1..d264e37 100644 --- a/cgi-bin/Sevenoaks.cgi +++ b/cgi-bin/Sevenoaks.cgi @@ -18,12 +18,16 @@ authority_name = "Sevenoaks District Council" authority_short_name = "Sevenoaks" base_url = "http://publicaccess.sevenoaks.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/South Bedfordshire.cgi b/cgi-bin/South Bedfordshire.cgi index 74717d7..f8322b9 100755 --- a/cgi-bin/South Bedfordshire.cgi +++ b/cgi-bin/South Bedfordshire.cgi @@ -18,12 +18,16 @@ authority_name = "South Bedfordshire District Council" authority_short_name = "South Bedfordshire" base_url = "http://planning.southbeds.gov.uk/plantech/DCWebPages/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.PgeSearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.SouthBedfordshireParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/South Bucks.cgi b/cgi-bin/South Bucks.cgi index 083f42e..f4cf41d 100644 --- a/cgi-bin/South Bucks.cgi +++ b/cgi-bin/South Bucks.cgi @@ -18,12 +18,16 @@ authority_name = "South Bucks District Council" authority_short_name = "South Bucks" base_url = "http://sbdc-paweb.southbucks.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/South Lakeland.cgi b/cgi-bin/South Lakeland.cgi index 36461e4..bfa0312 100755 --- a/cgi-bin/South Lakeland.cgi +++ b/cgi-bin/South Lakeland.cgi @@ -18,12 +18,16 @@ authority_name = "South Lakeland District Council" authority_short_name = "South Lakeland" base_url = "http://www.southlakeland.gov.uk/fastweb/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/South Ribble.cgi b/cgi-bin/South Ribble.cgi index 47b1339..3e7d8ed 100644 --- a/cgi-bin/South Ribble.cgi +++ b/cgi-bin/South Ribble.cgi @@ -18,12 +18,16 @@ authority_name = "South Ribble Borough Council" authority_short_name = "South Ribble" base_url = "http://publicaccess.southribble.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/South Staffordshire.cgi b/cgi-bin/South Staffordshire.cgi index de2d282..2e3f1ff 100644 --- a/cgi-bin/South Staffordshire.cgi +++ b/cgi-bin/South Staffordshire.cgi @@ -18,12 +18,16 @@ authority_name = "South Staffordshire Council" authority_short_name = "South Staffordshire" base_url = "https://services.sstaffs.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Southampton.cgi b/cgi-bin/Southampton.cgi index ef76c19..bc879c4 100644 --- a/cgi-bin/Southampton.cgi +++ b/cgi-bin/Southampton.cgi @@ -18,12 +18,16 @@ authority_name = "Southampton City Council" authority_short_name = "Southampton" base_url = "http://publicaccess.southampton.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Spelthorne.cgi b/cgi-bin/Spelthorne.cgi index 09d5a96..8506bfa 100644 --- a/cgi-bin/Spelthorne.cgi +++ b/cgi-bin/Spelthorne.cgi @@ -18,12 +18,16 @@ authority_name = "Spelthorne Borough Council" authority_short_name = "Spelthorne" base_url = "http://phoenix.spelthorne.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/St Helens.cgi b/cgi-bin/St Helens.cgi index 400756d..022f0a6 100644 --- a/cgi-bin/St Helens.cgi +++ b/cgi-bin/St Helens.cgi @@ -18,12 +18,16 @@ authority_name = "St Helens Council" authority_short_name = "St Helens" base_url = "http://212.248.225.150:8080/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.StHelensSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Stevenage.cgi b/cgi-bin/Stevenage.cgi index 858bf66..e0fcf0d 100644 --- a/cgi-bin/Stevenage.cgi +++ b/cgi-bin/Stevenage.cgi @@ -18,12 +18,16 @@ authority_name = "Stevenage Borough Council" authority_short_name = "Stevenage" base_url = "http://publicaccess.stevenage.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Stirling.cgi b/cgi-bin/Stirling.cgi index 7decad4..9fa9017 100644 --- a/cgi-bin/Stirling.cgi +++ b/cgi-bin/Stirling.cgi @@ -18,12 +18,16 @@ authority_name = "Stirling Council" authority_short_name = "Stirling" base_url = "http://planpub.stirling.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Stockton-On-Tees.cgi b/cgi-bin/Stockton-On-Tees.cgi index 7c06c3c..0a40e3b 100644 --- a/cgi-bin/Stockton-On-Tees.cgi +++ b/cgi-bin/Stockton-On-Tees.cgi @@ -18,12 +18,16 @@ authority_name = "Stockton-On-Tees Borough Council" authority_short_name = "Stockton-On-Tees" base_url = "http://www.developmentcontrol.stockton.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Stratford.cgi b/cgi-bin/Stratford.cgi index fa9a2df..e58549f 100644 --- a/cgi-bin/Stratford.cgi +++ b/cgi-bin/Stratford.cgi @@ -18,12 +18,16 @@ authority_name = "Stratford-on-Avon District Council" authority_short_name = "Stratford" base_url = "http://apps.stratford.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Suffolk Coastal.cgi b/cgi-bin/Suffolk Coastal.cgi index 4afe841..59a892d 100644 --- a/cgi-bin/Suffolk Coastal.cgi +++ b/cgi-bin/Suffolk Coastal.cgi @@ -18,12 +18,16 @@ authority_name = "Suffolk Coastal District Council" authority_short_name = "Suffolk Coastal" base_url = "https://apps3.suffolkcoastal.gov.uk/planningonline/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.SuffolkCoastalParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Sunderland.cgi b/cgi-bin/Sunderland.cgi index c4a0a94..a36d963 100644 --- a/cgi-bin/Sunderland.cgi +++ b/cgi-bin/Sunderland.cgi @@ -18,12 +18,16 @@ authority_name = "Sunderland City Council" authority_short_name = "Sunderland" base_url = "http://www.sunderland.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Surrey Heath.cgi b/cgi-bin/Surrey Heath.cgi index 9537585..b9f0980 100755 --- a/cgi-bin/Surrey Heath.cgi +++ b/cgi-bin/Surrey Heath.cgi @@ -18,12 +18,16 @@ authority_name = "Surrey Heath Borough Council" authority_short_name = "Surrey Heath" base_url = "https://www.public.surreyheath-online.gov.uk/whalecom60b1ef305f59f921/whalecom0/Scripts/PlanningPagesOnline/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch" +#print "Content-Type: text/html" # HTML is following +#print + import AcolnetParser parser = AcolnetParser.SurreyHeathParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Sutton.cgi b/cgi-bin/Sutton.cgi index b763f3e..b563c76 100755 --- a/cgi-bin/Sutton.cgi +++ b/cgi-bin/Sutton.cgi @@ -18,12 +18,16 @@ authority_name = "London Borough of Sutton" authority_short_name = "Sutton" base_url = "http://82.43.4.135/FASTWEB/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Teignbridge.cgi b/cgi-bin/Teignbridge.cgi index 5fb9f0a..b3a58e6 100644 --- a/cgi-bin/Teignbridge.cgi +++ b/cgi-bin/Teignbridge.cgi @@ -18,12 +18,16 @@ authority_name = "Teignbridge District Council" authority_short_name = "Teignbridge" base_url = "http://213.152.63.161/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Tendring.cgi b/cgi-bin/Tendring.cgi index 5b3d494..60f9846 100755 --- a/cgi-bin/Tendring.cgi +++ b/cgi-bin/Tendring.cgi @@ -18,12 +18,16 @@ authority_name = "Tendring District Council" authority_short_name = "Tendring" base_url = "http://195.99.151.54/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Test Valley.cgi b/cgi-bin/Test Valley.cgi index db59e33..2299312 100644 --- a/cgi-bin/Test Valley.cgi +++ b/cgi-bin/Test Valley.cgi @@ -18,12 +18,16 @@ authority_name = "Test Valley Borough Council" authority_short_name = "Test Valley" base_url = "http://publicaccess.testvalley.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Tonbridge.cgi b/cgi-bin/Tonbridge.cgi index 0c42fda..6f1f3cc 100644 --- a/cgi-bin/Tonbridge.cgi +++ b/cgi-bin/Tonbridge.cgi @@ -18,12 +18,16 @@ authority_name = "Tonbridge and Malling Borough Council" authority_short_name = "Tonbridge" base_url = "http://publicaccess.tmbc.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Torbay.cgi b/cgi-bin/Torbay.cgi index ff42303..5c0acb3 100644 --- a/cgi-bin/Torbay.cgi +++ b/cgi-bin/Torbay.cgi @@ -18,12 +18,16 @@ authority_name = "Torbay Council" authority_short_name = "Torbay" base_url = "http://www.torbay.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Vale Royal.cgi b/cgi-bin/Vale Royal.cgi index 2c440bf..b307656 100755 --- a/cgi-bin/Vale Royal.cgi +++ b/cgi-bin/Vale Royal.cgi @@ -18,12 +18,16 @@ authority_name = "Vale Royal Borough Council" authority_short_name = "Vale Royal" base_url = "http://pa.valeroyal.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Watford.cgi b/cgi-bin/Watford.cgi index dd71427..ec58fbf 100755 --- a/cgi-bin/Watford.cgi +++ b/cgi-bin/Watford.cgi @@ -18,12 +18,16 @@ authority_name = "Watford Borough Council" authority_short_name = "Watford" base_url = "http://ww3.watford.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Waveney.cgi b/cgi-bin/Waveney.cgi index f8597e9..6720172 100644 --- a/cgi-bin/Waveney.cgi +++ b/cgi-bin/Waveney.cgi @@ -18,12 +18,16 @@ authority_name = "Waveney District Council" authority_short_name = "Waveney" base_url = "http://publicaccess.waveney.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Wear Valley.cgi b/cgi-bin/Wear Valley.cgi index 5481f57..a3da0dc 100644 --- a/cgi-bin/Wear Valley.cgi +++ b/cgi-bin/Wear Valley.cgi @@ -18,12 +18,16 @@ authority_name = "Wear Valley District Council" authority_short_name = "Wear Valley" base_url = "http://planning.wearvalley.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.WearValleySearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Wellingborough.cgi b/cgi-bin/Wellingborough.cgi index fe69ea9..11bbeb7 100644 --- a/cgi-bin/Wellingborough.cgi +++ b/cgi-bin/Wellingborough.cgi @@ -18,12 +18,16 @@ authority_name = "Wellingborough Borough Council" authority_short_name = "Wellingborough" base_url = "http://planning.wellingborough.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import ApplicationSearchServletParser parser = ApplicationSearchServletParser.WellingboroughSearchParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Welwyn-Hatfield.cgi b/cgi-bin/Welwyn-Hatfield.cgi index 2babb8c..e07924e 100755 --- a/cgi-bin/Welwyn-Hatfield.cgi +++ b/cgi-bin/Welwyn-Hatfield.cgi @@ -18,12 +18,16 @@ authority_name = "Welwyn-Hatfield District Council" authority_short_name = "Welwyn-Hatfield" base_url = "https://fastweb.welhat.gov.uk/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/West Berkshire.cgi b/cgi-bin/West Berkshire.cgi index 1c40296..f96f0f9 100644 --- a/cgi-bin/West Berkshire.cgi +++ b/cgi-bin/West Berkshire.cgi @@ -18,12 +18,16 @@ authority_name = "West Berkshire Council" authority_short_name = "West Berkshire" base_url = "http://ww2.westberks.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/West Lancashire.cgi b/cgi-bin/West Lancashire.cgi index f654d7f..e62975c 100644 --- a/cgi-bin/West Lancashire.cgi +++ b/cgi-bin/West Lancashire.cgi @@ -18,12 +18,16 @@ authority_name = "West Lancashire District Council" authority_short_name = "West Lancashire" base_url = "http://publicaccess.westlancsdc.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/West Norfolk.cgi b/cgi-bin/West Norfolk.cgi index 51ac067..c644cfb 100644 --- a/cgi-bin/West Norfolk.cgi +++ b/cgi-bin/West Norfolk.cgi @@ -18,12 +18,16 @@ authority_name = "Kings Lynn and West Norfolk Borough Council" authority_short_name = "West Norfolk" base_url = "http://online.west-norfolk.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Winchester.cgi b/cgi-bin/Winchester.cgi index 15be732..a71218f 100755 --- a/cgi-bin/Winchester.cgi +++ b/cgi-bin/Winchester.cgi @@ -18,12 +18,16 @@ authority_name = "Winchester City Council" authority_short_name = "Winchester" base_url = "http://win2padmz.winchester.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Woking.cgi b/cgi-bin/Woking.cgi index 95ae4b7..74b8027 100644 --- a/cgi-bin/Woking.cgi +++ b/cgi-bin/Woking.cgi @@ -18,12 +18,16 @@ authority_name = "Woking Borough Council" authority_short_name = "Woking" base_url = "http://caps.woking.gov.uk/publicaccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Wolverhampton.cgi b/cgi-bin/Wolverhampton.cgi index 8c99117..f91ad61 100755 --- a/cgi-bin/Wolverhampton.cgi +++ b/cgi-bin/Wolverhampton.cgi @@ -18,12 +18,16 @@ authority_name = "Wolverhampton City Council" authority_short_name = "Wolverhampton" base_url = "http://planningonline.wolverhampton.gov.uk/PublicAccess/dc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/Wyre Forest.cgi b/cgi-bin/Wyre Forest.cgi index 9b8816d..b249410 100755 --- a/cgi-bin/Wyre Forest.cgi +++ b/cgi-bin/Wyre Forest.cgi @@ -18,12 +18,16 @@ authority_name = "Wyre Forest District Council" authority_short_name = "Wyre Forest" base_url = "http://www.wyreforest.gov.uk/fastweb/" +#print "Content-Type: text/html" # HTML is following +#print + import FastWeb parser = FastWeb.FastWeb(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/cgi-bin/York.cgi b/cgi-bin/York.cgi index 774cf06..11030b7 100644 --- a/cgi-bin/York.cgi +++ b/cgi-bin/York.cgi @@ -18,12 +18,16 @@ authority_name = "City of York Council" authority_short_name = "York" base_url = "http://planning.york.gov.uk/PublicAccess/tdc/" +#print "Content-Type: text/html" # HTML is following +#print + import PublicAccess parser = PublicAccess.PublicAccessParser(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml diff --git a/python_scrapers/AcolnetParser.py b/python_scrapers/AcolnetParser.py index a6ab243..a700188 100644 --- a/python_scrapers/AcolnetParser.py +++ b/python_scrapers/AcolnetParser.py @@ -4,6 +4,11 @@ import urllib, urllib2 import HTMLParser #from BeautifulSoup import BeautifulSoup +# Adding this to try to help Surrey Heath - Duncan 14/9/2007 +import cookielib +cookie_jar = cookielib.CookieJar() +################ + import urlparse import re @@ -154,9 +159,20 @@ class AcolnetParser(HTMLParser.HTMLParser): elif tag == "td": self._in_td = False + + def _getSearchResponse(self): + # It looks like we sometimes need to do some stuff to get around a + # javascript redirect and cookies. + search_form_request = urllib2.Request(self.base_url) + search_form_response = urllib2.urlopen(search_form_request) + + return search_form_response + + def getResultsByDayMonthYear(self, day, month, year): # first we fetch the search page to get ourselves some session info... - search_form_response = urllib2.urlopen(self.base_url) + search_form_response = self._getSearchResponse() + search_form_contents = search_form_response.read() #outfile = open("tmpfile", "w") @@ -418,16 +434,50 @@ class SuffolkCoastalParser(AcolnetParser): comments_email_address = "d.c.admin@suffolkcoastal.gov.uk" class SurreyHeathParser(AcolnetParser): + # This is not working yet. + # _getSearchResponse is an attempt to work around + # cookies and a javascript redirect. + # I may have a bit more of a go at this at some point if I have time. case_number_tr = 1 # this one can be got by the td class attribute reg_date_tr = 2 location_tr = 4 proposal_tr = 5 comments_email_address = "development-control@surreyheath.gov.uk" + + def _getSearchResponse(self): + # It looks like we sometimes need to do some stuff to get around a + # javascript redirect and cookies. + search_form_request = urllib2.Request(self.base_url) + + # Lying about the user-agent doesn't seem to help. + #search_form_request.add_header("user-agent", "Mozilla/5.0 (compatible; Konqu...L/3.5.6 (like Gecko) (Kubuntu)") + + search_form_response = urllib2.urlopen(search_form_request) + + cookie_jar.extract_cookies(search_form_response, search_form_request) + + + print search_form_response.geturl() + print search_form_response.info() + + print search_form_response.read() +# validate_url = "https://www.public.surreyheath-online.gov.uk/whalecom7cace3215643e22bb7b0b8cc97a7/whalecom0/InternalSite/Validate.asp" +# javascript_redirect_url = urlparse.urljoin(self.base_url, "/whalecom7cace3215643e22bb7b0b8cc97a7/whalecom0/InternalSite/RedirectToOrigURL.asp?site_name=public&secure=1") + +# javascript_redirect_request = urllib2.Request(javascript_redirect_url) +# javascript_redirect_request.add_header('Referer', validate_url) + +# cookie_jar.add_cookie_header(javascript_redirect_request) + +# javascript_redirect_response = urllib2.urlopen(javascript_redirect_request) + +# return javascript_redirect_response + if __name__ == '__main__': - day = 15 - month = 3 + day = 31 + month = 8 year = 2007 # returns error 400 - bad request @@ -440,6 +490,6 @@ if __name__ == '__main__': # results as columns of one table parser = SurreyHeathParser("Surrey Heath", "Surrey Heath", "https://www.public.surreyheath-online.gov.uk/whalecom60b1ef305f59f921/whalecom0/Scripts/PlanningPagesOnline/acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch") - + print parser.getResults(day, month, year) diff --git a/python_scrapers/CGITemplate b/python_scrapers/CGITemplate index 080d016..0950f07 100644 --- a/python_scrapers/CGITemplate +++ b/python_scrapers/CGITemplate @@ -16,12 +16,16 @@ authority_name = "%(authority_name)s" authority_short_name = "%(authority_short_name)s" base_url = "%(base_url)s" +#print "Content-Type: text/html" # HTML is following +#print + import %(module)s parser = %(module)s.%(parser)s(authority_name, authority_short_name, base_url) xml = parser.getResults(day, month, year) + print "Content-Type: text/xml" # XML is following print print xml # print the xml