Detecting Carrier Type, Company and Location from Phone Number

Detecting Carrier Type, Company and Location from Phone Number

I was talking to a company today that does “voicemail drops” (so they don’t actually call you, they just drop a message into your voicemail.

We were discussing how nice it would be if you could know who the carrier was and/or where the respondent was located.

I mentioned that I’d learned some years ago that the prefix / Exchange was tied to a given carrier and that we should be able to reverse-engineer the information pretty easily.

In this video I walk through how to automate the process and, quickly ,extract the information from the web page.

Here is the article I mentioned during the video and below is the video and script I wrote¬† (I realized after recording the video I could have done w/o the loop.¬† Take a look at the script below…

Video Walk Through: Detecting Carrier Type, Company and Location from Phone Number

 

Detecting Carrier Type, Company and Location from Phone Number

#SingleInstance,Force
;**************************************
Area_Code:="267"
Prefix:="777"

pwb := WBGet()
pwb.Navigate("http://www.fonefinder.net/findome.php?npa=" Area_Code "&nxx=" Prefix) ;Navigate to URL
while pwb.busy or pwb.ReadyState != 4 ;Wait for page to load
	Sleep, 100

Row:=pwb.document.GetElementsByTagName("table")[1].GetElementsByTagName("TR")[1]
Loop, % Row.GetElementsByTagName("TD").length {
	If (A_Index=3)
		City:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
	If (A_Index=4)
		State:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
	If (A_Index=5)
		Tel_Comp:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
	If (A_Index=6)
		Carrier_Type:=Row.GetElementsByTagName("TD")[A_Index-1].InnerText
}
MsgBox % City a_tab State a_tab Tel_comp a_tab Carrier_Type

;*******************************************************
;~ Alternatively you could skip the above loop and just do...
        City:=Row.GetElementsByTagName("TD")[2].InnerText
       State:=Row.GetElementsByTagName("TD")[3].InnerText
    Tel_Comp:=Row.GetElementsByTagName("TD")[4].InnerText
Carrier_Type:=Row.GetElementsByTagName("TD")[5].InnerText
MsgBox % City a_tab State a_tab Tel_comp a_tab Carrier_Type

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.