Sfoglia il codice sorgente

fixes to api

import/raw
memespring 18 anni fa
parent
commit
d6f3d5495e
4 ha cambiato i file con 11 aggiunte e 8 eliminazioni
  1. +4
    -2
      trunk/docs/api.php
  2. +3
    -3
      trunk/docs/scrapers/cityoflondon.php
  3. +1
    -1
      trunk/docs/templates/apihowto.tpl
  4. +3
    -2
      trunk/docs/templates/rss.tpl

+ 4
- 2
trunk/docs/api.php Vedi File

@@ -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));


+ 3
- 3
trunk/docs/scrapers/cityoflondon.php Vedi File

@@ -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);


+ 1
- 1
trunk/docs/templates/apihowto.tpl Vedi File

@@ -2,7 +2,7 @@

<h3>PlanningAlerts.com API</h3>
<p>
Planning application data is available programmatically as <a href="http://georss.org/">GeoRSS feeds</a>. GeoRSS can be used in most all web mapping APIs and desktop GIS software, and in services like <a href="http://mapufacture.com">mapufacture</a> and <a href="http://pipes.yahoo.com/">Yahoo Pipes</a>.
Planning application data is available programmatically as <a href="http://georss.org/">GeoRSS feeds</a>. GeoRSS can be used in almost most all web mapping APIs and desktop GIS software, and in services like <a href="http://mapufacture.com">mapufacture</a> and <a href="http://pipes.yahoo.com/">Yahoo Pipes</a>.
<p/>

<p>


+ 3
- 2
trunk/docs/templates/rss.tpl Vedi File

@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:georss="http://georss.org/georss">
<rss version="2.0" xmlns:georss="http://www.georss.org/georss">
<channel>
<title>Search Results</title>
<title>PlanningAlerts.com</title>
<link>http://www.planningalerts.com/</link>
<description></description>
{foreach name="applications" from="$applications" item="application"}
<item>
<title>{$application->address}</title>
<guid isPermaLink="false">{$application->council_reference}</guid>
<georss:featurename>{$application->address}</georss:featurename>
<georss:point>{$application->lat} {$application->lon}</georss:point>


Caricamento…
Annulla
Salva