Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whitepages free API Beta 1

Status
Not open for further replies.

jdhilljr

Programmer
Sep 1, 2003
296
US
If anyone is interested White Pages has a free beta API at
Here's a quick code I use to grab the xml response.


loXMLRequest = CreateObject("Msxml2.xmlhttp")
loXMLRequest.open("GET"," + xfname + }"zip=" + ALLTRIM(xpostalcode) + ";api_key=xxxxyourapicodexxx",.F.)
loXMLRequest.send(.null.)
lcXML = loXMLRequest.responseText
x = 1
DO WHILE AT('<wp:listing>',lcXML,x) > 0
lcYML = SUBSTR(lcXML,AT('<wp:listing>',lcXML,x),AT('</wp:listing>',lcXML,x)-AT('<wp:listing>',lcXML,x))
wpfname = SUBSTR(lcYML,AT("<wp:firstname>",lcYML)+14,AT("</wp:firstname>",lcYML)-(AT("<wp:firstname>",lcYML)+14))
wplname = SUBSTR(lcYML,AT("<wp:lastname>",lcYML)+13,AT("</wp:lastname>",lcYML)-(AT("<wp:lastname>",lcYML)+13))
wpphone = SUBSTR(lcYML,AT("<wp:fullphone>",lcYML)+14,AT("</wp:fullphone>",lcYML)-(AT("<wp:fullphone>",lcYML)+14))
wpstreet = SUBSTR(lcYML,AT("<wp:fullstreet>",lcYML)+15,AT("</wp:fullstreet>",lcYML)-(AT("<wp:fullstreet>",lcYML)+15))
wpcity = SUBSTR(lcYML,AT("<wp:city>",lcYML)+9,AT("</wp:city>",lcYML)-(AT("<wp:city>",lcYML)+9))
wpstate = SUBSTR(lcYML,AT("<wp:state>",lcYML)+10,AT("</wp:state>",lcYML)-(AT("<wp:state>",lcYML)+10))
wpzip = SUBSTR(lcYML,AT("<wp:zip>",lcYML)+8,AT("</wp:zip>",lcYML)-(AT("<wp:zip>",lcYML)+8))
SELECT 3

APPEND BLANK
replace fname WITH wpfname
replace lname WITH wplname
replace phone WITH wpphone
replace address WITH wpstreet
replace city WITH wpcity
replace state WITH wpstate
replace zip WITH wpzip
replace date WITH DATETIME()
x = x + 1
ENDDO

If you can't stand behind your troops, stand in front of them.
Semper Fidelis

Jim
 
That works well!
* = finders fee

This old world keeps spinning round - It's a wonder tall trees ain't layin' down
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top