ソースを参照

tidyed up html a bit

master
memespring 18年前
コミット
45928efc5f
15個のファイルの変更51行の追加33行の削除
  1. +1
    -1
      data/%%0A^0A3^0A3EFF25%%faq.tpl.php
  2. +1
    -1
      data/%%0E^0E4^0E407559%%footer.tpl.php
  3. +3
    -1
      data/%%45^45E^45E480CD%%index.tpl.php
  4. +2
    -2
      data/%%6D^6DB^6DB28CFA%%about.tpl.php
  5. +1
    -1
      data/%%AD^AD7^AD71B708%%rss.tpl.php
  6. +1
    -1
      data/%%D2^D26^D26D8BFE%%xml.tpl.php
  7. +2
    -2
      data/%%F7^F75^F752BDC0%%getinvolved.tpl.php
  8. +3
    -1
      data/%%F7^F7F^F7F34188%%header.tpl.php
  9. +1
    -1
      docs/api.php
  10. +19
    -10
      docs/include/scraper_support.php
  11. +1
    -1
      docs/scrapers/camden.php
  12. +2
    -2
      docs/scrapers/islington.php
  13. +1
    -1
      docs/templates/about.tpl
  14. +11
    -8
      docs/templates/apihowto.tpl
  15. +2
    -0
      docs/templates/index.tpl

+ 1
- 1
data/%%0A^0A3^0A3EFF25%%faq.tpl.php ファイルの表示

@@ -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 */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));


+ 1
- 1
data/%%0E^0E4^0E407559%%footer.tpl.php ファイルの表示

@@ -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 */ ?>
</div>
<div id="divFooter">


+ 3
- 1
data/%%45^45E^45E480CD%%index.tpl.php ファイルの表示

@@ -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 */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$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">
<h4>Recent site updates</h4>
<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>
</ul>
</div>


+ 2
- 2
data/%%6D^6DB^6DB28CFA%%about.tpl.php ファイルの表示

@@ -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 */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$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>
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>

<h3 id="authorities">Planning authorities currently covered by the service</h3>


+ 1
- 1
data/%%AD^AD7^AD71B708%%rss.tpl.php ファイルの表示

@@ -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 */ ?>
<?php echo '<?xml'; ?>
version="1.0" encoding="UTF-8"<?php echo '?>'; ?>


+ 1
- 1
data/%%D2^D26^D26D8BFE%%xml.tpl.php ファイルの表示

@@ -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 */ ?>
<?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); ?>


+ 2
- 2
data/%%F7^F75^F752BDC0%%getinvolved.tpl.php ファイルの表示

@@ -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 */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$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);
?>

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


+ 3
- 1
data/%%F7^F7F^F7F34188%%header.tpl.php ファイルの表示

@@ -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 */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -22,6 +22,8 @@
<div id="divMenu">
<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'] == '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'] == '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>


+ 1
- 1
docs/api.php ファイルの表示

@@ -84,7 +84,7 @@ class api {
$smarty->force_compile = true;
$smarty->compile_dir = SMARTY_COMPILE_DIRECTORY;

$smarty->assign("page_title","API HOWTO");
$smarty->assign("page_title","API");
$smarty->assign("menu_item","api");

$smarty->display('apihowto.tpl');


+ 19
- 10
docs/include/scraper_support.php ファイルの表示

@@ -80,7 +80,7 @@ function scrape_applications_publicaccess ($search_url, $info_url_base, $comment
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();
$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->address = $application_match[3];
//$application->status = $application_match[4];
//if weve found a caase number, then get the details
if($case_number !=""){
//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 = 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);

if (isset($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
$html = safe_scrape_page($search_url);


preg_match_all($application_pattern, $html, $application_matches, PREG_PATTERN_ORDER);

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
$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
$details_html = "";
$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
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_pattern = '/Main location:<\/label><\/td>([^<]*)<td colspan="3">([^<]*)/';


+ 1
- 1
docs/scrapers/camden.php ファイルの表示

@@ -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=";

//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");



+ 2
- 2
docs/scrapers/islington.php ファイルの表示

@@ -22,13 +22,13 @@ if (isset($_GET['year'])){
}

//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&regtodate=#daterange";
$date_range = "{$day}-{$month}-{$year}";
$search_url = str_replace("#daterange", $date_range, $search_url);

//comment and info urls
$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
$applications = scrape_applications_islington($search_url, $info_url_base, $comment_url_base);


+ 1
- 1
docs/templates/about.tpl ファイルの表示

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

<h3 id="authorities">Planning authorities currently covered by the service</h3>


+ 11
- 8
docs/templates/apihowto.tpl ファイルの表示

@@ -1,13 +1,15 @@
{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>
Construct an api request as follows.
Either lat/lng or postcode is required. area_size is always required.<br>
<p/>
<code>
http://www.planningalerts.com/api.php?<br>
&nbsp;lat=[some latitude]<br>
@@ -15,8 +17,9 @@
&nbsp;&postcode=[some postcode]<br>
&nbsp;&area_size=['s' 'm' or 'l']
</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"}

+ 2
- 0
docs/templates/index.tpl ファイルの表示

@@ -42,6 +42,8 @@
<div id="divSiteUpdates">
<h4>Recent site updates</h4>
<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>
</ul>
</div>


読み込み中…
キャンセル
保存