Permalink
Browse files

Barnet scraper.

  • Loading branch information...
1 parent ffc1146 commit b5a65fc3fce9a86d7dc92447d37177b75691572d Matthew Somerville committed Sep 29, 2010
View
@@ -3,3 +3,4 @@
/conf/general.deployed
/conf/httpd.conf
/conf/httpd.conf.deployed
+/data
View
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+#
+# GPLv2.
+
+import sys
+import datetime
+import simplejson
+from scraper import AcolnetParser
+
+parser = AcolnetParser.AcolnetParser('', '',
+ "http://planningcases.barnet.gov.uk/planning-cases/acolnetcgi.exe?ACTION=UNWRAP&RIPNAME=Root.pgesearch"
+)
+
+date = datetime.date.today() - datetime.timedelta(days=1)
+results = parser.getResultsByDayMonthYear(date.day, date.month, date.year)
+
+out = []
+for app in results.planning_applications:
+ out.append({
+ 'council_reference': app.council_reference,
+ 'address': app.address,
+ 'postcode': app.postcode,
+ 'description': app.description,
+ 'info_url': app.info_url,
+ 'received': app.date_received.isoformat(),
+ })
+
+fp = open(sys.path[0] + '/../data/apps-%s' % date, 'w')
+simplejson.dump(out, fp)
+
Oops, something went wrong.

0 comments on commit b5a65fc

Please sign in to comment.