Postal Code/Locator

Ilya Palagin IlyaPalagin-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Mon Feb 16 20:49:43 UTC 2004


David Mayerlen wrote:
>>> Anybody ever build a store locator? Something along the idea of having a
>>>user enter a postal code and then showing them a list of nearby stores?
>>>
>>> Any suggestions much appreciated.
>>>
>>> I wrote a locator in Perl that worked on a little bit of a drill-down
>>>scenario with a few maps that broke down Ontario into regions and gave
>>>lists of stores for those regions BUT I'm pulling my hair out trying to
>>>find the darn thing!!!
>>
>>Isn't this matter of grep'ing a file with store addresses?
>>
> 
> 
>  More than that. Need to compare a user's postal code to the available
> store postal codes and determine which ones are sorta nearby.
> 

Clumsy, but cheap solution: with LWP (WWW library for Perl) you can send 
requests to http://ca.maps.yahoo.com, doing "Driving directions" 
requests between several points you've broken down Ontarion into and 
your client's location. Just compare distances then. If your traffic 
isn't too hard, and yahoo doesn't change its Canada Maps interface too 
often, this may work.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list