|
Nearcode |
|
Example Name: BookFinder.htm Language: HTML API type: HTML CGI API component filename: mcdquery.exe
Environment: Web Browser |
|
What does it do? |
|
Demonstrates calling the CGI client via the POST method. Uses multiple templates to handle the different result statuses. This example is designed to work with the Nearcode Libraries Pool.
|
|
Could be used as a
starting point for: |
|
Store Finder website showing a list of nearest stores. |
|
Where to find the
example code: |
|
After running the setup from the Nearcode CD to install the
client APIs you will find these examples installed (by default) in: C:\Program Files\Capscan\SDK\Nearcode Client API\CGI\Examples If you have installed to another location you will need to change
the path where necessary.
|
|
What each file does: |
|
File name What does it do? BookFinder.htm Passes
address details from the form to mcdquery.exe to return a list of libraries
and their distance from the query address. BookFinderA.htm Template used
for ambiguous result. BookFinderN.htm Template used
when no hits are found. BookFinderS.htm Template used
for successful result. |
|
Preparing to run the
example: |
|
Please make sure that you have installed the Capscan Pool Manager
and that it is up and running.
|
|
Running the example: |
|
1.
Make sure mcdquery.exe is in cgi-bin. 2.
Make sure the Libraries pool is set in the
local spider.ini file. 3.
Copy near2.htm to the document root folder
of the web server (wwwroot in IIS). 4.
Open Internet Explorer and enter http://themachinename/BookFinder.htm. Where “themachinename”
is the name of the machine that has the HTML page in its document root. 5.
When the example page has loaded, enter a
postcode and click the Submit button.
A list of library addresses should appear below the form, along with
the distance from the query postcode in miles and kilometres.
|
|
Trouble-shooting and
hints: |
|
1.
If you are running on a LAN make sure that
the Capscan Pool Manager is running correctly. To do this you can use the Pool Manager
Admin application that is installed along with the Capscan Pool Manager. 2.
If you are using a firewall make sure that
it is not blocking this example or the Capscan Pool Manager. By default the Capscan Client/Server uses
port 27920 for sending and receiving data. 3.
For more hints and tips please see the SDK
bookshelf documentation.
|