Pārlūkot izejas kodu

use postcode from address when no postcode is available in publicaccess

parser
add currently failing surrey heath parser
master
duncan.parkes pirms 17 gadiem
vecāks
revīzija
cef4ccbcf6
100 mainītis faili ar 44 papildinājumiem un 4 dzēšanām
  1. +11
    -3
      cgi-bin/AcolnetParser.py
  2. +0
    -0
      cgi-bin/Allerdale.cgi
  3. +0
    -0
      cgi-bin/Alnwick.cgi
  4. +0
    -0
      cgi-bin/Angus.cgi
  5. +0
    -0
      cgi-bin/Aylesbury Vale.cgi
  6. +0
    -0
      cgi-bin/Babergh.cgi
  7. +0
    -0
      cgi-bin/Barrow.cgi
  8. +0
    -0
      cgi-bin/Basildon.cgi
  9. +0
    -0
      cgi-bin/Basingstoke and Deane.cgi
  10. +0
    -0
      cgi-bin/Bassetlaw.cgi
  11. +0
    -0
      cgi-bin/Bath.cgi
  12. +0
    -0
      cgi-bin/Bexley.cgi
  13. +0
    -0
      cgi-bin/Blaby.cgi
  14. +0
    -0
      cgi-bin/Bolsover.cgi
  15. +0
    -0
      cgi-bin/Bridgnorth.cgi
  16. +0
    -0
      cgi-bin/Bristol.cgi
  17. +0
    -0
      cgi-bin/Buckinghamshire.cgi
  18. +0
    -0
      cgi-bin/Bury.cgi
  19. +0
    -0
      cgi-bin/Carlisle.cgi
  20. +0
    -0
      cgi-bin/Chelmsford.cgi
  21. +0
    -0
      cgi-bin/Cherwell.cgi
  22. +0
    -0
      cgi-bin/Chorley.cgi
  23. +0
    -0
      cgi-bin/City of London.cgi
  24. +0
    -0
      cgi-bin/Cornwall.cgi
  25. +0
    -0
      cgi-bin/Coventry.cgi
  26. +0
    -0
      cgi-bin/Croydon.cgi
  27. +0
    -0
      cgi-bin/Denbighshire.cgi
  28. +0
    -0
      cgi-bin/Derby.cgi
  29. +0
    -0
      cgi-bin/Doncaster.cgi
  30. +0
    -0
      cgi-bin/Dundee.cgi
  31. +0
    -0
      cgi-bin/Durham.cgi
  32. +0
    -0
      cgi-bin/Ealing.cgi
  33. +0
    -0
      cgi-bin/Easington.cgi
  34. +0
    -0
      cgi-bin/East Devon.cgi
  35. +0
    -0
      cgi-bin/East Dorset.cgi
  36. +0
    -0
      cgi-bin/East Lindsey.cgi
  37. +0
    -0
      cgi-bin/Edinburgh.cgi
  38. +0
    -0
      cgi-bin/Epsom and Ewell.cgi
  39. +0
    -0
      cgi-bin/Fenland.cgi
  40. +0
    -0
      cgi-bin/Fylde.cgi
  41. +0
    -0
      cgi-bin/Gateshead.cgi
  42. +0
    -0
      cgi-bin/Gedling.cgi
  43. +0
    -0
      cgi-bin/Gloucestershire.cgi
  44. +0
    -0
      cgi-bin/Gravesham.cgi
  45. +0
    -0
      cgi-bin/Hammersmith and Fulham.cgi
  46. +0
    -0
      cgi-bin/Haringey.cgi
  47. +0
    -0
      cgi-bin/Harlow.cgi
  48. +0
    -0
      cgi-bin/Harrogate.cgi
  49. +0
    -0
      cgi-bin/Hart.cgi
  50. +0
    -0
      cgi-bin/Hartlepool.cgi
  51. +0
    -0
      cgi-bin/Hertsmere.cgi
  52. +0
    -0
      cgi-bin/High Peak.cgi
  53. +0
    -0
      cgi-bin/Huntingdonshire.cgi
  54. +0
    -0
      cgi-bin/Kerrier.cgi
  55. +0
    -0
      cgi-bin/Knowsley.cgi
  56. +0
    -0
      cgi-bin/Lancaster.cgi
  57. +0
    -0
      cgi-bin/Lewisham.cgi
  58. +0
    -0
      cgi-bin/Luton.cgi
  59. +0
    -0
      cgi-bin/Malvern Hills.cgi
  60. +0
    -0
      cgi-bin/Manchester.cgi
  61. +0
    -0
      cgi-bin/Mid Devon.cgi
  62. +0
    -0
      cgi-bin/Milton Keynes.cgi
  63. +0
    -0
      cgi-bin/NW Leicestershire.cgi
  64. +0
    -0
      cgi-bin/New Forest.cgi
  65. +0
    -0
      cgi-bin/Newcastle-under-Lyme.cgi
  66. +0
    -0
      cgi-bin/Newcastle.cgi
  67. +0
    -0
      cgi-bin/Newham.cgi
  68. +0
    -0
      cgi-bin/North Hertfordshire.cgi
  69. +0
    -0
      cgi-bin/North Tyneside.cgi
  70. +0
    -0
      cgi-bin/North Warwickshire.cgi
  71. +0
    -0
      cgi-bin/North Wiltshire.cgi
  72. +0
    -0
      cgi-bin/Northumberland.cgi
  73. +0
    -0
      cgi-bin/Oadby and Wigston.cgi
  74. +0
    -0
      cgi-bin/Oldham.cgi
  75. +0
    -0
      cgi-bin/Oswestry.cgi
  76. +0
    -0
      cgi-bin/Peterborough.cgi
  77. +0
    -0
      cgi-bin/Portsmouth.cgi
  78. +4
    -1
      cgi-bin/PublicAccess.py
  79. +0
    -0
      cgi-bin/Redditch.cgi
  80. +0
    -0
      cgi-bin/Renfrewshire.cgi
  81. +0
    -0
      cgi-bin/Rushmoor.cgi
  82. +0
    -0
      cgi-bin/Scarborough.cgi
  83. +0
    -0
      cgi-bin/Selby.cgi
  84. +0
    -0
      cgi-bin/Sevenoaks.cgi
  85. +0
    -0
      cgi-bin/South Bedfordshire.cgi
  86. +0
    -0
      cgi-bin/South Bucks.cgi
  87. +0
    -0
      cgi-bin/South Ribble.cgi
  88. +0
    -0
      cgi-bin/South Staffordshire.cgi
  89. +0
    -0
      cgi-bin/SouthOxfordshire.cgi
  90. +0
    -0
      cgi-bin/Southampton.cgi
  91. +0
    -0
      cgi-bin/Spelthorne.cgi
  92. +0
    -0
      cgi-bin/St Helens.cgi
  93. +0
    -0
      cgi-bin/Stevenage.cgi
  94. +0
    -0
      cgi-bin/Stirling.cgi
  95. +0
    -0
      cgi-bin/Stockton-On-Tees.cgi
  96. +0
    -0
      cgi-bin/Stratford.cgi
  97. +0
    -0
      cgi-bin/Suffolk Coastal.cgi
  98. +0
    -0
      cgi-bin/Sunderland.cgi
  99. +29
    -0
      cgi-bin/Surrey Heath.cgi
  100. +0
    -0
      cgi-bin/Teignbridge.cgi

+ 11
- 3
cgi-bin/AcolnetParser.py Parādīt failu

@@ -159,8 +159,8 @@ class AcolnetParser(HTMLParser.HTMLParser):
search_form_response = urllib2.urlopen(self.base_url)
search_form_contents = search_form_response.read()

#outfile = open("tmpfile", "w")
#outfile.write(search_form_contents)
outfile = open("tmpfile", "w")
outfile.write(search_form_contents)

# This sometimes causes a problem in HTMLParser, so let's just get the link
# out with a regex...
@@ -410,6 +410,14 @@ class SuffolkCoastalParser(AcolnetParser):
proposal_tr = 5

comments_email_address = "d.c.admin@suffolkcoastal.gov.uk"

class SurreyHeathParser(AcolnetParser):
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"
if __name__ == '__main__':
day = 15
@@ -425,7 +433,7 @@ if __name__ == '__main__':
# canterbury
# results as columns of one table

parser = OldhamParser("Oldham", "Oldham", "http://planning.oldham.gov.uk/planning//acolnetcgi.gov?ACTION=UNWRAP&RIPNAME=Root.pgesearch")
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)

+ 0
- 0
cgi-bin/Allerdale.cgi Parādīt failu


+ 0
- 0
cgi-bin/Alnwick.cgi Parādīt failu


+ 0
- 0
cgi-bin/Angus.cgi Parādīt failu


+ 0
- 0
cgi-bin/Aylesbury Vale.cgi Parādīt failu


+ 0
- 0
cgi-bin/Babergh.cgi Parādīt failu


+ 0
- 0
cgi-bin/Barrow.cgi Parādīt failu


+ 0
- 0
cgi-bin/Basildon.cgi Parādīt failu


+ 0
- 0
cgi-bin/Basingstoke and Deane.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bassetlaw.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bath.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bexley.cgi Parādīt failu


+ 0
- 0
cgi-bin/Blaby.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bolsover.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bridgnorth.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bristol.cgi Parādīt failu


+ 0
- 0
cgi-bin/Buckinghamshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Bury.cgi Parādīt failu


+ 0
- 0
cgi-bin/Carlisle.cgi Parādīt failu


+ 0
- 0
cgi-bin/Chelmsford.cgi Parādīt failu


+ 0
- 0
cgi-bin/Cherwell.cgi Parādīt failu


+ 0
- 0
cgi-bin/Chorley.cgi Parādīt failu


+ 0
- 0
cgi-bin/City of London.cgi Parādīt failu


+ 0
- 0
cgi-bin/Cornwall.cgi Parādīt failu


+ 0
- 0
cgi-bin/Coventry.cgi Parādīt failu


+ 0
- 0
cgi-bin/Croydon.cgi Parādīt failu


+ 0
- 0
cgi-bin/Denbighshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Derby.cgi Parādīt failu


+ 0
- 0
cgi-bin/Doncaster.cgi Parādīt failu


+ 0
- 0
cgi-bin/Dundee.cgi Parādīt failu


+ 0
- 0
cgi-bin/Durham.cgi Parādīt failu


+ 0
- 0
cgi-bin/Ealing.cgi Parādīt failu


+ 0
- 0
cgi-bin/Easington.cgi Parādīt failu


+ 0
- 0
cgi-bin/East Devon.cgi Parādīt failu


+ 0
- 0
cgi-bin/East Dorset.cgi Parādīt failu


+ 0
- 0
cgi-bin/East Lindsey.cgi Parādīt failu


+ 0
- 0
cgi-bin/Edinburgh.cgi Parādīt failu


+ 0
- 0
cgi-bin/Epsom and Ewell.cgi Parādīt failu


+ 0
- 0
cgi-bin/Fenland.cgi Parādīt failu


+ 0
- 0
cgi-bin/Fylde.cgi Parādīt failu


+ 0
- 0
cgi-bin/Gateshead.cgi Parādīt failu


+ 0
- 0
cgi-bin/Gedling.cgi Parādīt failu


+ 0
- 0
cgi-bin/Gloucestershire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Gravesham.cgi Parādīt failu


+ 0
- 0
cgi-bin/Hammersmith and Fulham.cgi Parādīt failu


+ 0
- 0
cgi-bin/Haringey.cgi Parādīt failu


+ 0
- 0
cgi-bin/Harlow.cgi Parādīt failu


+ 0
- 0
cgi-bin/Harrogate.cgi Parādīt failu


+ 0
- 0
cgi-bin/Hart.cgi Parādīt failu


+ 0
- 0
cgi-bin/Hartlepool.cgi Parādīt failu


+ 0
- 0
cgi-bin/Hertsmere.cgi Parādīt failu


+ 0
- 0
cgi-bin/High Peak.cgi Parādīt failu


+ 0
- 0
cgi-bin/Huntingdonshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Kerrier.cgi Parādīt failu


+ 0
- 0
cgi-bin/Knowsley.cgi Parādīt failu


+ 0
- 0
cgi-bin/Lancaster.cgi Parādīt failu


+ 0
- 0
cgi-bin/Lewisham.cgi Parādīt failu


+ 0
- 0
cgi-bin/Luton.cgi Parādīt failu


+ 0
- 0
cgi-bin/Malvern Hills.cgi Parādīt failu


+ 0
- 0
cgi-bin/Manchester.cgi Parādīt failu


+ 0
- 0
cgi-bin/Mid Devon.cgi Parādīt failu


+ 0
- 0
cgi-bin/Milton Keynes.cgi Parādīt failu


+ 0
- 0
cgi-bin/NW Leicestershire.cgi Parādīt failu


+ 0
- 0
cgi-bin/New Forest.cgi Parādīt failu


+ 0
- 0
cgi-bin/Newcastle-under-Lyme.cgi Parādīt failu


+ 0
- 0
cgi-bin/Newcastle.cgi Parādīt failu


+ 0
- 0
cgi-bin/Newham.cgi Parādīt failu


+ 0
- 0
cgi-bin/North Hertfordshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/North Tyneside.cgi Parādīt failu


+ 0
- 0
cgi-bin/North Warwickshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/North Wiltshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Northumberland.cgi Parādīt failu


+ 0
- 0
cgi-bin/Oadby and Wigston.cgi Parādīt failu


+ 0
- 0
cgi-bin/Oldham.cgi Parādīt failu


+ 0
- 0
cgi-bin/Oswestry.cgi Parādīt failu


+ 0
- 0
cgi-bin/Peterborough.cgi Parādīt failu


+ 0
- 0
cgi-bin/Portsmouth.cgi Parādīt failu


+ 4
- 1
cgi-bin/PublicAccess.py Parādīt failu

@@ -10,7 +10,7 @@ import cookielib
cookie_jar = cookielib.CookieJar()


from PlanningUtils import fixNewlines, PlanningAuthorityResults, PlanningApplication
from PlanningUtils import fixNewlines, getPostcodeFromText, PlanningAuthorityResults, PlanningApplication


search_form_url_end = "DcApplication/application_searchform.aspx"
@@ -167,6 +167,9 @@ class PublicAccessParser(HTMLParser.HTMLParser):
# one found on the property page
if property_file_parser.postcode is not None:
self._current_application.postcode = property_file_parser.postcode
else:
# If there is no postcode in here, then we'll have to make do with regexing one out of the address.
self._current_application.postcode = getPostcodeFromText(self._current_application.address)

# There is no need for us to look at any more attributes.
break


+ 0
- 0
cgi-bin/Redditch.cgi Parādīt failu


+ 0
- 0
cgi-bin/Renfrewshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Rushmoor.cgi Parādīt failu


+ 0
- 0
cgi-bin/Scarborough.cgi Parādīt failu


+ 0
- 0
cgi-bin/Selby.cgi Parādīt failu


+ 0
- 0
cgi-bin/Sevenoaks.cgi Parādīt failu


+ 0
- 0
cgi-bin/South Bedfordshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/South Bucks.cgi Parādīt failu


+ 0
- 0
cgi-bin/South Ribble.cgi Parādīt failu


+ 0
- 0
cgi-bin/South Staffordshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/SouthOxfordshire.cgi Parādīt failu


+ 0
- 0
cgi-bin/Southampton.cgi Parādīt failu


+ 0
- 0
cgi-bin/Spelthorne.cgi Parādīt failu


+ 0
- 0
cgi-bin/St Helens.cgi Parādīt failu


+ 0
- 0
cgi-bin/Stevenage.cgi Parādīt failu


+ 0
- 0
cgi-bin/Stirling.cgi Parādīt failu


+ 0
- 0
cgi-bin/Stockton-On-Tees.cgi Parādīt failu


+ 0
- 0
cgi-bin/Stratford.cgi Parādīt failu


+ 0
- 0
cgi-bin/Suffolk Coastal.cgi Parādīt failu


+ 0
- 0
cgi-bin/Sunderland.cgi Parādīt failu


+ 29
- 0
cgi-bin/Surrey Heath.cgi Parādīt failu

@@ -0,0 +1,29 @@
#!/usr/local/bin/python

# This is the parser for Surrey Heath Borough Council.
# it is generated from the file CGITemplate

import cgi
import cgitb
#cgitb.enable(display=0, logdir="/tmp")


form = cgi.FieldStorage()
day = form.getfirst('day')
month = form.getfirst('month')
year = form.getfirst('year')


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"

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

+ 0
- 0
cgi-bin/Teignbridge.cgi Parādīt failu


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels

Notiek ielāde…
Atcelt
Saglabāt