Pārlūkot izejas kodu

fixes to api

master
memespring pirms 18 gadiem
vecāks
revīzija
33fdb39001
4 mainītis faili ar 11 papildinājumiem un 8 dzēšanām
  1. +4
    -2
      docs/api.php
  2. +3
    -3
      docs/scrapers/cityoflondon.php
  3. +1
    -1
      docs/templates/apihowto.tpl
  4. +3
    -2
      docs/templates/rss.tpl

+ 4
- 2
docs/api.php Parādīt failu

@@ -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
docs/scrapers/cityoflondon.php Parādīt failu

@@ -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
docs/templates/apihowto.tpl Parādīt failu

@@ -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
docs/templates/rss.tpl Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt