@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-01-18 21:20:37 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:13:34 | |||||
compiled from faq.tpl */ ?> | compiled from faq.tpl */ ?> | ||||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | <?php $_smarty_tpl_vars = $this->_tpl_vars; | ||||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | $this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-17 15:57:52 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:13:35 | |||||
compiled from footer.tpl */ ?> | compiled from footer.tpl */ ?> | ||||
</div> | </div> | ||||
<div id="divFooter"> | <div id="divFooter"> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-17 15:24:25 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:12:43 | |||||
compiled from index.tpl */ ?> | compiled from index.tpl */ ?> | ||||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | <?php $_smarty_tpl_vars = $this->_tpl_vars; | ||||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | $this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | ||||
@@ -54,6 +54,8 @@ unset($_smarty_tpl_vars); | |||||
<div id="divSiteUpdates"> | <div id="divSiteUpdates"> | ||||
<h4>Recent site updates</h4> | <h4>Recent site updates</h4> | ||||
<ul class="nobullets"> | <ul class="nobullets"> | ||||
<li><em>March 2007</em> Added an API and a few more councils (inc. Islington and Hackney)</li> | |||||
<li><em>February 2007</em> Added loads more councils (inc. Camden and Tower Hamlets)</li> | |||||
<li><em>December 2006</em> beta launch</li> | <li><em>December 2006</em> beta launch</li> | ||||
</ul> | </ul> | ||||
</div> | </div> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-17 15:57:51 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:12:32 | |||||
compiled from about.tpl */ ?> | compiled from about.tpl */ ?> | ||||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | <?php $_smarty_tpl_vars = $this->_tpl_vars; | ||||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | $this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | ||||
@@ -8,7 +8,7 @@ unset($_smarty_tpl_vars); | |||||
<p>You'd probably know if your next door neighbour was going to knock their house down (you'd get a letter through the door telling you they had applied for planning permission and asking you what you thought about it). But you probably never find out if the old cinema or pub 5 streets away is going to be converted into luxury flats until <a href="http://www.bbc.co.uk/cult/hitchhikers/gallery/tv/fordprosser.shtml">the bulldozers turned up</a>.</p> | <p>You'd probably know if your next door neighbour was going to knock their house down (you'd get a letter through the door telling you they had applied for planning permission and asking you what you thought about it). But you probably never find out if the old cinema or pub 5 streets away is going to be converted into luxury flats until <a href="http://www.bbc.co.uk/cult/hitchhikers/gallery/tv/fordprosser.shtml">the bulldozers turned up</a>.</p> | ||||
<p> | <p> | ||||
PlanningAlerts.com is a free service built by <a href="http://www.memespring.co.uk">Richard Pope</a> and <a href="http://brainoff.com">Mikel Maron</a> kindly hosted by <a href="http://www.mysociety.org">mySociety.org</a>. It searches as many local authority planning websites as it can find and emails you details of applications near you. The aim of this to enable shared scrutiny of what is being built (and <a href="http://www.urban75.net/vbulletin/showthread.php?t=154006" title="Death of the Queen">knocked down</a>) in peoples communities. | |||||
PlanningAlerts.com is a free service built by <a href="http://www.memespring.co.uk">Richard Pope</a>, <a href="http://brainoff.com">Mikel Maron</a>, Sam Smith and Duncan Parkes. The site is kindly hosted by <a href="http://www.mysociety.org">mySociety.org</a>. It searches as many local authority planning websites as it can find and emails you details of applications near you. The aim of this to enable shared scrutiny of what is being built (and <a href="http://www.urban75.net/vbulletin/showthread.php?t=154006" title="Death of the Queen">knocked down</a>) in peoples communities. | |||||
</p> | </p> | ||||
<h3 id="authorities">Planning authorities currently covered by the service</h3> | <h3 id="authorities">Planning authorities currently covered by the service</h3> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-20 21:55:51 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-23 17:55:19 | |||||
compiled from rss.tpl */ ?> | compiled from rss.tpl */ ?> | ||||
<?php echo '<?xml'; ?> | <?php echo '<?xml'; ?> | ||||
version="1.0" encoding="UTF-8"<?php echo '?>'; ?> | version="1.0" encoding="UTF-8"<?php echo '?>'; ?> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-02-04 11:17:43 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 10:15:51 | |||||
compiled from xml.tpl */ ?> | compiled from xml.tpl */ ?> | ||||
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); | <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); | ||||
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'xml.tpl', 6, false),)), $this); ?> | smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'xml.tpl', 6, false),)), $this); ?> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-01-26 09:58:31 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:13:35 | |||||
compiled from getinvolved.tpl */ ?> | compiled from getinvolved.tpl */ ?> | ||||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | <?php $_smarty_tpl_vars = $this->_tpl_vars; | ||||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | $this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | ||||
@@ -6,7 +6,7 @@ $this->_tpl_vars = $_smarty_tpl_vars; | |||||
unset($_smarty_tpl_vars); | unset($_smarty_tpl_vars); | ||||
?> | ?> | ||||
<p>PlanningAlerts.com is run by volunteers if you would like to get involved we'd love to here from you:</p> | |||||
<p>PlanningAlerts.com is run by volunteers. If you would like to get involved we'd love to here from you:</p> | |||||
<h3>I am a programmer and want to add my local authority</h3> | <h3>I am a programmer and want to add my local authority</h3> | ||||
<p> | <p> | ||||
@@ -1,4 +1,4 @@ | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-17 15:57:51 | |||||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:13:47 | |||||
compiled from header.tpl */ ?> | compiled from header.tpl */ ?> | ||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||||
@@ -22,6 +22,8 @@ | |||||
<div id="divMenu"> | <div id="divMenu"> | ||||
<ul class="collapse"> | <ul class="collapse"> | ||||
<li <?php if ($this->_tpl_vars['menu_item'] == 'about'): ?>class="selected"<?php endif; ?>><a href="about.php">About</a></li> | <li <?php if ($this->_tpl_vars['menu_item'] == 'about'): ?>class="selected"<?php endif; ?>><a href="about.php">About</a></li> | ||||
<li <?php if ($this->_tpl_vars['menu_item'] == 'api'): ?>class="selected"<?php endif; ?>><a href="api.php?howto">API</a></li> | |||||
<li <?php if ($this->_tpl_vars['menu_item'] == 'getinvolved'): ?>class="selected"<?php endif; ?>><a href="getinvolved.php">Get involved</a></li> | <li <?php if ($this->_tpl_vars['menu_item'] == 'getinvolved'): ?>class="selected"<?php endif; ?>><a href="getinvolved.php">Get involved</a></li> | ||||
<li <?php if ($this->_tpl_vars['menu_item'] == 'faq'): ?>class="selected"<?php endif; ?>><a href="faq.php"><acronym title="Frequently asked questions">FAQ</acronym>s</a></li> | <li <?php if ($this->_tpl_vars['menu_item'] == 'faq'): ?>class="selected"<?php endif; ?>><a href="faq.php"><acronym title="Frequently asked questions">FAQ</acronym>s</a></li> | ||||
<li <?php if ($this->_tpl_vars['menu_item'] == 'signup'): ?>class="selected"<?php endif; ?>><a href="/">Signup</a></li> | <li <?php if ($this->_tpl_vars['menu_item'] == 'signup'): ?>class="selected"<?php endif; ?>><a href="/">Signup</a></li> | ||||
@@ -84,7 +84,7 @@ class api { | |||||
$smarty->force_compile = true; | $smarty->force_compile = true; | ||||
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | $smarty->compile_dir = SMARTY_COMPILE_DIRECTORY; | ||||
$smarty->assign("page_title","API HOWTO"); | |||||
$smarty->assign("page_title","API"); | |||||
$smarty->assign("menu_item","api"); | $smarty->assign("menu_item","api"); | ||||
$smarty->display('apihowto.tpl'); | $smarty->display('apihowto.tpl'); | ||||
@@ -80,7 +80,7 @@ function scrape_applications_publicaccess ($search_url, $info_url_base, $comment | |||||
return $applications; | return $applications; | ||||
} | } | ||||
function scrape_applications_wam ($search_url, $info_url_base, $comment_url_base){ | |||||
function scrape_applications_wam ($search_url, $info_url_base, $comment_url_base, $detail_mode = 1){ | |||||
$applications = array(); | $applications = array(); | ||||
$application_pattern = '/<tr><td class=[^>]*>([^<]*)<\/td><td class=[^>]*><a href="[^"]*">([^<]*)<\/a><\/td><td class=[^>]*>([^<]*)<\/td><td class=[^>]*>([^<]*)<\/td>/'; | $application_pattern = '/<tr><td class=[^>]*>([^<]*)<\/td><td class=[^>]*><a href="[^"]*">([^<]*)<\/a><\/td><td class=[^>]*>([^<]*)<\/td><td class=[^>]*>([^<]*)<\/td>/'; | ||||
@@ -105,7 +105,7 @@ function scrape_applications_wam ($search_url, $info_url_base, $comment_url_base | |||||
$application->date_received = $application_match[1]; | $application->date_received = $application_match[1]; | ||||
$application->address = $application_match[3]; | $application->address = $application_match[3]; | ||||
//$application->status = $application_match[4]; | //$application->status = $application_match[4]; | ||||
//if weve found a caase number, then get the details | //if weve found a caase number, then get the details | ||||
if($case_number !=""){ | if($case_number !=""){ | ||||
//Comment and info urls | //Comment and info urls | ||||
@@ -125,9 +125,16 @@ function scrape_applications_wam ($search_url, $info_url_base, $comment_url_base | |||||
$details_html = safe_scrape_page($info_url_base . $case_number); | $details_html = safe_scrape_page($info_url_base . $case_number); | ||||
$details_html = str_replace("\r\n","",$details_html); | $details_html = str_replace("\r\n","",$details_html); | ||||
//regular expresion and clean | |||||
$full_detail_pattern = '/Development:<.*<td colspan="3">([^<]*)<\/td>/'; | |||||
//regular expresion and clean. SItes vary a tiny bit in their html, so there's a bit of a hack here | |||||
if ($detail_mode == 1){ | |||||
$full_detail_pattern = '/Development:<.*<td colspan="3">([^<]*)<\/td>/'; | |||||
} | |||||
if ($detail_mode == 2){ | |||||
$full_detail_pattern = '/Development:<\/td><td>([^<]*)/'; | |||||
} | |||||
preg_match($full_detail_pattern, $details_html, $full_detail_matches); | preg_match($full_detail_pattern, $details_html, $full_detail_matches); | ||||
if (isset($full_detail_matches[1])){ | if (isset($full_detail_matches[1])){ | ||||
$application->description = $full_detail_matches[1]; | $application->description = $full_detail_matches[1]; | ||||
} | } | ||||
@@ -165,7 +172,6 @@ function scrape_applications_islington ($search_url, $info_url_base, $comment_ur | |||||
//grab the page | //grab the page | ||||
$html = safe_scrape_page($search_url); | $html = safe_scrape_page($search_url); | ||||
preg_match_all($application_pattern, $html, $application_matches, PREG_PATTERN_ORDER); | preg_match_all($application_pattern, $html, $application_matches, PREG_PATTERN_ORDER); | ||||
foreach ($application_matches[0] as $application_match){ | foreach ($application_matches[0] as $application_match){ | ||||
@@ -182,17 +188,20 @@ function scrape_applications_islington ($search_url, $info_url_base, $comment_ur | |||||
//Comment and info urls | //Comment and info urls | ||||
$application->info_url = $info_url_base . $application->council_reference; | $application->info_url = $info_url_base . $application->council_reference; | ||||
//$application->comment_url = $comment_url_base . $case_number; | |||||
$application->comment_url = $comment_url_base . $application->council_reference; | |||||
//get full details | //get full details | ||||
$details_html = ""; | $details_html = ""; | ||||
$details_html = safe_scrape_page($info_url_base . $application->council_reference); | $details_html = safe_scrape_page($info_url_base . $application->council_reference); | ||||
// $details_html = str_replace("\n","", $details_html); | |||||
// $details_html = str_replace("\t","", $details_html); | |||||
$details_html = str_replace("\r\n","",$details_html); | |||||
//Details | //Details | ||||
print $details_html;exit; | |||||
$full_detail_pattern = '/Proposal:<\/label><\/td>([^<]*)<td colspan="3">([^<]*)/'; | |||||
preg_match($full_detail_pattern, $details_html, $full_detail_matches); | |||||
if (isset($full_detail_matches[2])){ | |||||
$application->description = $full_detail_matches[2]; | |||||
} | |||||
//Address | //Address | ||||
$address_pattern = '/Main location:<\/label><\/td>([^<]*)<td colspan="3">([^<]*)/'; | $address_pattern = '/Main location:<\/label><\/td>([^<]*)<td colspan="3">([^<]*)/'; | ||||
@@ -16,7 +16,7 @@ $info_url_base = "http://planningonline.camden.gov.uk/WAM/showCaseFile.do?action | |||||
$comment_url_base = "http://planningonine.camden.gov.uk/WAM/createComment.do?action=CreateApplicationComment&&applicationType=Planning&appNumber="; | $comment_url_base = "http://planningonine.camden.gov.uk/WAM/createComment.do?action=CreateApplicationComment&&applicationType=Planning&appNumber="; | ||||
//grab urls | //grab urls | ||||
$applications = scrape_applications_wam($search_url, $info_url_base, $comment_url_base); | |||||
$applications = scrape_applications_wam($search_url, $info_url_base, $comment_url_base, 1); | |||||
display_applications($applications, "Camden Council", "Camden"); | display_applications($applications, "Camden Council", "Camden"); | ||||
@@ -22,13 +22,13 @@ if (isset($_GET['year'])){ | |||||
} | } | ||||
//search url | //search url | ||||
$search_url = "https://www.islington.gov.uk/onlineplanning/apas/run/Wphappcriteria.showApplications?decfromdate=#daterange&dectodate=#daterange"; | |||||
$search_url = "https://www.islington.gov.uk/onlineplanning/apas/run/Wphappcriteria.showApplications?regfromdate=#daterange®todate=#daterange"; | |||||
$date_range = "{$day}-{$month}-{$year}"; | $date_range = "{$day}-{$month}-{$year}"; | ||||
$search_url = str_replace("#daterange", $date_range, $search_url); | $search_url = str_replace("#daterange", $date_range, $search_url); | ||||
//comment and info urls | //comment and info urls | ||||
$info_url_base = "https://www.islington.gov.uk/onlineplanning/apas/run/WPHAPPDETAIL.DisplayUrl?theApnID="; | $info_url_base = "https://www.islington.gov.uk/onlineplanning/apas/run/WPHAPPDETAIL.DisplayUrl?theApnID="; | ||||
$comment_url_base = "http://www.blaby.gov.uk/publicaccess/dc/DcApplication/application_comments_entryform.aspx?caseno="; | |||||
$comment_url_base = "https://www.islington.gov.uk/onlineplanning/apas/run/wphmakerep.displayURL?ApnID="; | |||||
//grab urls | //grab urls | ||||
$applications = scrape_applications_islington($search_url, $info_url_base, $comment_url_base); | $applications = scrape_applications_islington($search_url, $info_url_base, $comment_url_base); | ||||
@@ -2,7 +2,7 @@ | |||||
<p>You'd probably know if your next door neighbour was going to knock their house down (you'd get a letter through the door telling you they had applied for planning permission and asking you what you thought about it). But you probably never find out if the old cinema or pub 5 streets away is going to be converted into luxury flats until <a href="http://www.bbc.co.uk/cult/hitchhikers/gallery/tv/fordprosser.shtml">the bulldozers turned up</a>.</p> | <p>You'd probably know if your next door neighbour was going to knock their house down (you'd get a letter through the door telling you they had applied for planning permission and asking you what you thought about it). But you probably never find out if the old cinema or pub 5 streets away is going to be converted into luxury flats until <a href="http://www.bbc.co.uk/cult/hitchhikers/gallery/tv/fordprosser.shtml">the bulldozers turned up</a>.</p> | ||||
<p> | <p> | ||||
PlanningAlerts.com is a free service built by <a href="http://www.memespring.co.uk">Richard Pope</a> and <a href="http://brainoff.com">Mikel Maron</a> kindly hosted by <a href="http://www.mysociety.org">mySociety.org</a>. It searches as many local authority planning websites as it can find and emails you details of applications near you. The aim of this to enable shared scrutiny of what is being built (and <a href="http://www.urban75.net/vbulletin/showthread.php?t=154006" title="Death of the Queen">knocked down</a>) in peoples communities. | |||||
PlanningAlerts.com is a free service built by <a href="http://www.memespring.co.uk">Richard Pope</a>, <a href="http://brainoff.com">Mikel Maron</a>, Sam Smith and Duncan Parkes. The site is kindly hosted by <a href="http://www.mysociety.org">mySociety.org</a>. It searches as many local authority planning websites as it can find and emails you details of applications near you. The aim of this to enable shared scrutiny of what is being built (and <a href="http://www.urban75.net/vbulletin/showthread.php?t=154006" title="Death of the Queen">knocked down</a>) in peoples communities. | |||||
</p> | </p> | ||||
<h3 id="authorities">Planning authorities currently covered by the service</h3> | <h3 id="authorities">Planning authorities currently covered by the service</h3> | ||||
@@ -1,13 +1,15 @@ | |||||
{include file="header.tpl"} | {include file="header.tpl"} | ||||
<dl class="faq"> | |||||
<dt>PlanningAlerts.com API</dt> | |||||
<dd> | |||||
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>. | |||||
<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>. | |||||
<p/> | <p/> | ||||
<p> | |||||
Construct an api request as follows. | Construct an api request as follows. | ||||
Either lat/lng or postcode is required. area_size is always required.<br> | Either lat/lng or postcode is required. area_size is always required.<br> | ||||
<p/> | <p/> | ||||
<code> | <code> | ||||
http://www.planningalerts.com/api.php?<br> | http://www.planningalerts.com/api.php?<br> | ||||
lat=[some latitude]<br> | lat=[some latitude]<br> | ||||
@@ -15,8 +17,9 @@ | |||||
&postcode=[some postcode]<br> | &postcode=[some postcode]<br> | ||||
&area_size=['s' 'm' or 'l'] | &area_size=['s' 'm' or 'l'] | ||||
</code> | </code> | ||||
<p/> | |||||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">an example query</a> | |||||
</dd> | |||||
</dl> | |||||
<p> | |||||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">an example query</a> | |||||
</p> | |||||
{include file="footer.tpl"} | {include file="footer.tpl"} |
@@ -42,6 +42,8 @@ | |||||
<div id="divSiteUpdates"> | <div id="divSiteUpdates"> | ||||
<h4>Recent site updates</h4> | <h4>Recent site updates</h4> | ||||
<ul class="nobullets"> | <ul class="nobullets"> | ||||
<li><em>March 2007</em> Added an API and a few more councils (inc. Islington and Hackney)</li> | |||||
<li><em>February 2007</em> Added loads more councils (inc. Camden and Tower Hamlets)</li> | |||||
<li><em>December 2006</em> beta launch</li> | <li><em>December 2006</em> beta launch</li> | ||||
</ul> | </ul> | ||||
</div> | </div> | ||||