From 33fdb3900111ac0688e1de8da889bf0d7ca28895 Mon Sep 17 00:00:00 2001 From: memespring Date: Sat, 24 Mar 2007 17:53:11 +0000 Subject: [PATCH] fixes to api --- docs/api.php | 6 ++++-- docs/scrapers/cityoflondon.php | 6 +++--- docs/templates/apihowto.tpl | 2 +- docs/templates/rss.tpl | 5 +++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/api.php b/docs/api.php index 332b0f9..95092e1 100644 --- a/docs/api.php +++ b/docs/api.php @@ -41,13 +41,15 @@ class api { //Get OS ref from postcode if (isset($_GET['postcode'])) { $xy = postcode_to_location($_GET['postcode']); + $this->easting = $xy[0]; + $this->northing = $xy[1]; } else { $latlng = new LatLng($_GET['lat'], $_GET['lng']); $xy = $latlng->toOSRef(); + $this->easting = $xy->easting; + $this->northing = $xy->northing; } - $this->easting = $xy->easting; - $this->northing = $xy->northing; $this->area_size = $_GET['area_size']; $this->applications = Applications::query($this->easting, $this->northing, alert_size_to_meters($this->area_size)); diff --git a/docs/scrapers/cityoflondon.php b/docs/scrapers/cityoflondon.php index 5b4a1d3..5c262ad 100644 --- a/docs/scrapers/cityoflondon.php +++ b/docs/scrapers/cityoflondon.php @@ -15,13 +15,13 @@ if (isset($_GET['year'])){ } //search url - $search_url = "http://www.planning.cityoflondon.gov.uk/dc/DcApplication/application_searchresults.aspx?searchtype=WEEKLY&selWeeklyListRange=#daterange&weektype=VAL"; + $search_url = "http://www.planning.cityoflondon.gov.uk/PublicAccess/tdc/DcApplication/application_searchresults.aspx?searchtype=WEEKLY&selWeeklyListRange=#daterange&weektype=VAL"; $date_range = "{$day}%2F{$month}%2F{$year}%7C{$day}%2F{$month}%2F{$year}"; $search_url = str_replace("#daterange", $date_range, $search_url); //comment and info urls - $info_url_base = "http://www.planning.cityoflondon.gov.uk/dc/DcApplication/application_detailview.aspx?caseno="; - $comment_url_base = "http://www.planning.cityoflondon.gov.uk/dc/DcApplication/application_comments_entryform.aspx?caseno="; + $info_url_base = "http://www.planning.cityoflondon.gov.uk/PublicAccess/tdc/DcApplication/application_detailview.aspx?caseno="; + $comment_url_base = "http://www.planning.cityoflondon.gov.uk/PublicAccess/tdc/DcApplication/application_comments_entryform.aspx?caseno="; //grab urls $applications = scrape_applications_publicaccess($search_url, $info_url_base, $comment_url_base); diff --git a/docs/templates/apihowto.tpl b/docs/templates/apihowto.tpl index 28d6012..58a8162 100644 --- a/docs/templates/apihowto.tpl +++ b/docs/templates/apihowto.tpl @@ -2,7 +2,7 @@

PlanningAlerts.com API

- Planning application data is available programmatically as GeoRSS feeds. GeoRSS can be used in most all web mapping APIs and desktop GIS software, and in services like mapufacture and Yahoo Pipes. + Planning application data is available programmatically as GeoRSS feeds. GeoRSS can be used in almost most all web mapping APIs and desktop GIS software, and in services like mapufacture and Yahoo Pipes.

diff --git a/docs/templates/rss.tpl b/docs/templates/rss.tpl index 2db1a97..4d98009 100644 --- a/docs/templates/rss.tpl +++ b/docs/templates/rss.tpl @@ -1,11 +1,12 @@ - + - Search Results + PlanningAlerts.com http://www.planningalerts.com/ {foreach name="applications" from="$applications" item="application"} + {$application->address} {$application->council_reference} {$application->address} {$application->lat} {$application->lon}