PhoneLoader - Look up phones numbers ==================================== (C)2006, 2007 Jon Ripley & Jonathan Harston PhoneLoader is a program that will automatically search for telephone numbers on BT's phonebook website, and creates a TPSClean import file suitable for importing into EARS. Setting up ---------- You need to get the base URL to use to search for telephone numbers in your area. To do this, go to BT's online phonebook search site at: http://www.thephonebook.bt.com/ Follow the link to Residential numbers and enter a known search, such as your own name and address. Ensure the appropriate links are followed to specify the correct town, etc. When you get the search result, copy URL to clipboard. Open the configuration file 'phoneldr.ini' and paste the URL from the clipboard to the line starting with 'url='. The file will look something like: [PhoneLdr] url=http://www.thephonebook.bt.com/publisha.content/en/search/residential/search.publisha?Surname=Harston&Initial=J&Street=70+Camm+Street&Town=SHEFFIELD++&Postcode=&x=28&y=9&Location=SHEFFIELD++%7b+-+YORKSHIRE%7d&OriginalLocation=SHEFFIELD++&Range=xloc The PhoneLdr.ini file needs to be in the same directory as PhoneLdr.exe. Running ------- To search for telephone numbers you need to create a search list from EARS. Export the names you want to search for to a file formatted as follows: PD:POLLNUM:FORENAME:SURNAME:HOUSE:DETAIL:ROAD:AREA:POSTTOWN:POSTCODE:HPHONE When you run PhoneLoader you get a FileOpen dialogue to load the export file. Once you have selected it, the program chugs through it sending a search request to the phonebook site to look for each entry. Phone numbers found are output to a TPSClean file in the same directory as the import file. This can then be imported into EARS. This takes some time - about two seconds per search - so you may want to leave the program running overnight. Importing telephone numbers --------------------------- PhoneLoader will have created a file called TPSClean.zip. In click on the 'Phone' button and select 'Import TPS cleaned file'. The OpenFile dialogue prompts you for the file created by PhoneLoader. Navigate to the directory and select the file. EARS starts by looking for a file with your license number in the name, for example TPS951.zip, the file you need will be called TPSClean.zip unless you have changed it. You will be prompted with 'OK to use dated dd/mm/yyyy?' Select YES, and the new numbers will be imported. Extras ------ PhoneLoader will take command line arguments to automate processing. These are: PhoneLdr [] [-ini ] [-delay ] [-text] -? displays the above help text. specifies the import file. A relative path refers to the directory that PhoneLdr.exe is in. specifies the output file. A relative path refers to the directory that PhoneLdr.exe is in. -ini specifies a particular .ini configuation file to use. By default, PhoneLoader looks for a PhoneLdr.ini file in the same directory as PhoneLdr.exe. -delay allows you to specify a delay in centiseconds between each telephone number search. By default this is 1.5s to avoid swamping the phonebook website. If you reduce this too much you may get blocked by BT's servers. -text specifies that the output file should be left as plain text. Without the -text switch, the output file is a ZIP archive. Problems -------- If the PhoneBook website decides that you are making too many searches it will temporarily block access. PhoneLdr detects this and stops with the message 'Phonebook site timed out due to high usage - come back to finish later'. The output file will be tided up and closed, and it will contain everything found up to that point. You should import these numbers and generate another search file to restart with later. If the phonebook URL is not in the format PhoneLoader expects, it will display the message 'Unexpected URL format'. The most likely case for this is BT changing their phonebook API. This can only be solved by a newer version of PhoneLoader. History ------- v1.00 29-04-2006 JJR: Original version by Jon Ripley. v1.01 30-04-2006 JGH: Added TPS format output to zip file. v1.02 20-06-2006 JGH: Uses GetOpenFileName dialogue. v1.03 29-08-2006 JGH: URL configurable via .ini file. v1.04 02-03-2007 JGH: Opens output file only when needed.