Jump to content

Get email, full name, address,... from Whois !


Recommended Posts

for Example:

Registrant:

EyePlastics, LLC

601 Providence Park

Mobile, Alabama 36695

United States

Registered through: GoDaddy.com, Inc. (http://www.godaddy.com)

Domain Name: DRMARKBROWN.COM

Created on: 14-May-04

Expires on: 14-May-12

Last Updated on: 09-May-09

Administrative Contact:

Brown, Mark Mark@eyeplastics.com

EyePlastics, LLC

601 Providence Park

Mobile, Alabama 36695

United States

2516502020 Fax --

Technical Contact:

Brown, Mark Mark@eyeplastics.com

EyePlastics, LLC

601 Providence Park

Mobile, Alabama 36695

United States

2516502020 Fax --

Domain servers in listed order:

NS09.DOMAINCONTROL.COM

NS10.DOMAINCONTROL.COM

the only thing I can extract is email:

$mail=StringRegExp($Text,"\w+@\w+.\w+",2)

And the full name, maybe I take the first line of Administrative Contact.

But my real problem is: to take the address " 601 Providence Park", in some case it lay on the third or the second line of Administrative Contact, I don't know when to get the 2nd or 3rd ! And the address, country !

All I want to know is to check which link is address,email,full name....

I've searched a lot but I found nothing !

Now, I need your help !

Thanks !

Link to comment
Share on other sites

Here is one I did a few months ago. You will probably find what you need (or close to it) in here.

#include<inet.au3>
$sUBase = "http://whois.domaintools.com/"
$Gw = 450
$Gh = 400
$Frm_main = GUICreate("Domain Lookup", $Gw, $Gh)
$In_Lookup = GUICtrlCreateInput("Enter the domain or IP address", 10,10, 250, 20)
$btn_Go = GUICtrlCreateButton("Go", 290, 10, 40, 20)
$Btn_Copy = GUICtrlCreateButton("Copy", 360, 10, 40, 20)
GUICtrlSetState($Btn_Copy, 144)
$Edit_Results = GUICtrlCreateEdit("", 10, 40, $Gw-20, $Gh - 50, BitOR(0x0800, 0x00200000, 0x00100000))
GUISetState()

While 1
   $gMsg = GUIGetMsg()
   Switch $gMsg
      Case -3
         Exit
      Case $Btn_Go
         GUICtrlSetData($Edit_Results, "")
         $sURL = GUICtrlRead($In_Lookup)
         If NOT StringInStr($sURL, ".") Then
            GUICtrlSetState($In_Lookup, 256)
            ContinueLoop
         EndIf
         $sURL = StringReplace($sUrl, "http:\\","")
         $sURL = StringReplace($sURL, "www.", "")
         GUISetCursor(15, 1)
         $sStr = _InetGetSource($sUBase & $sURL)
        ;ClipPut($sStr)
        ;$sStr = ClipGet()
         $sStr = StringRegExp($sStr, "(?i)<p class=\\?'whois_record\\?'>([domain|org].*[name|not]?.+)</p>", 1)
         If NOT @Error Then
            $sStr = $sStr[0]
            GUICtrlSetData($Edit_Results, _FixString($sStr))
            GUICtrlSetState($Btn_Copy, 80)
            GUISetCursor(-1)
         Else
            $sStr = "Unable to complete the search." & @CRLF & @CRLF
            $sStr &= "Most likely causes:" & @CRLF & "You entered an invalid address." & @CRLF 
            $sStr &= "You have exceeded your maximum number of lookups for the day."
            GUICtrlSetData($Edit_Results, $sStr)
            GUISetCursor(-1)
         EndIf
      Case $Btn_Copy
         ClipPut(GuiCtrlRead($Edit_Results))
      Case Else
   EndSwitch
Wend

Func _FixString($sStr)
   $sStr = StringReplace($sStr, "&nbsp;", Chr(32))
   $sStr = StringRegExpReplace($sStr, "(?i)<br\s?/?>", @CRLF)
   $sStr = StringReplace($sStr, "&amp;", "&")
   $sStr = StringReplace($sStr, "<p>",  @CRLF & @CRLF)
   $sStr = StringRegExpReplace($sStr, "(?i)\(?<a title=\\.?Search for this email address\\.+>\)?", @CRLF)
   $sStr = StringRegExpReplace($sStr,"<.+>.*", "")
   $sStr = StringRegExpReplace($sStr, "(?i).+email:.*\v?", "")
   $sStr = StringRegExpReplace($sStr, "(?i)([a-z]+)\s*(:)\h*(.*)", "$1$2 $3")
   Return $sStr
EndFunc

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...