Changeset 591
- Timestamp:
- Oct 17, 2007, 3:22:37 PM (13 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/npemap.org.uk/scripts/npemap-importer/importer.pl
r590 r591 3 3 # ---------------------- 4 4 # 5 # This script handles downloading the latest NPEMaps dataset export , and6 # the latest FreeThePostcode export, and importing theminto a local5 # This script handles downloading the latest NPEMaps dataset export (but 6 # not the latest FreeThePostcode export), and importing it into a local 7 7 # copy of the NPE Maps database. 8 8 # This allows you to run your own copy of the NPE Maps api, and have it 9 9 # loaded with the latest data nightly / weekly 10 # (You will almost certainly want to schedule a run of the 11 # freethepostcode importer too) 12 # 10 13 # Warning - you should not be tracking bad postcodes if you use this 11 # script, as it will zap everything between runs! 14 # script, as it will zap everything it has previously imported between 15 # runs! 12 16 13 17 # Find our private perl libraries … … 23 27 if($?) { exit $?; } 24 28 29 # Our entry in the sources table 30 my $source = 2; 31 25 32 # Clear out the current entries 26 33 my $dbh = setup_dbh(); 27 my $del = $dbh->prepare("DELETE FROM postcodes"); 28 $del->execute(); 29 30 # Our entry in the sources table 31 my $source = 2; 34 my $del = $dbh->prepare("DELETE FROM postcodes WHERE source = ?"); 35 $del->execute($source); 32 36 33 37 # Load up the new ones … … 49 53 # Close our connection 50 54 $dbh->disconnect; 51 52 # Run the FTP importer53 print `$FindBin::Bin/../freethepostcode.org-importer/importer.py --download --no-confirm`;
Note: See TracChangeset
for help on using the changeset viewer.