Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Always save record as planningalerts now does versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed May 7, 2019
1 parent 0bb47d9 commit a0f0348
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions scraper.php
Expand Up @@ -144,15 +144,9 @@ function buildformdata($dom, $eventtarget) {
'date_received' => date('Y-m-d', strtotime($date_received))
);

# Check if record exist, if not, INSERT, else do nothing
$existingRecords = scraperwiki::select("* from data where `council_reference`='" . $application['council_reference'] . "'");
if (count($existingRecords) == 0) {
print ("Saving record " . $application['council_reference'] . "\n");
# print_r ($application);
scraperwiki::save(array('council_reference'), $application);
} else {
print ("Skipping already saved record " . $application['council_reference'] . "\n");
}
print ("Saving record " . $application['council_reference'] . "\n");
# print_r ($application);
scraperwiki::save(array('council_reference'), $application);
}
}

Expand Down

0 comments on commit a0f0348

Please sign in to comment.