• ogomez
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi. I recently instituted a web-to-lead form on our website, and I received advice that asking for a visitor's ZIP code is a nice non-intrusive way of gathering useful, but still ambiguous, information about where they live. This, in turn, is useful for all kinds of segmenting, obviously.

 

So, now I have a database with some rather poor data quality: some records have just addresses with no ZIP, some have ZIPs without a city, barely any have a county entered, etc.

 

I'm wondering if there is a relatively simple way to harvest this kind of information from an address. In fact, I won't be greedy, I'll settle for determining county from a ZIP code, which seems like it would be the easiest – ZIPs are a standardized format, as opposed to city names or addresses. There are two paid apps in the app store (PostCode and AddressGrabber), but we are a nonprofit, so the cheaper we can get this done, the better.

 

I wonder if there is some way to write an S-Control that would harvest the city information with a process like this:

1) Enter a ZIP into MapQuest, by calling up this address: http://www.mapquest.com/maps?zipcode=[ZIP]

2) Get the source and harvest the title of the resulting URL by parsing this formula: "Map of [CITY, STATE] by MapQuest"

 

Can this be done with relatively a simple Javascript, built into an S-Control? And then where to go from there?

 

I have a very long formula field set up to assign zones (our segmentation scheme) from counties, but it is just one huge hand-coded switch/case syntax. An approach like that is completely impractical for something like ZIPs or Cities.

 

Thanks in advance.

Ryan