Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

External IP address UDF


  • Please log in to reply
5 replies to this topic

#1 Splash

Splash

    Wayfarer

  • Active Members
  • Pip
  • 76 posts

Posted 12 November 2009 - 06:57 PM

AutoIt         
;By Igor Ferreira Cemim ;igor.cemim at yahoo.com.br ;<a href='http://www.autoitscript.com/forum/index.php?showuser=46021' class='bbc_url' title=''>http://www.autoitscript.com/forum/index.php?showuser=46021</a> ;Search a valid IP address on a given URL. Func searchIP($URL = "<a href='http://www.ip-adress.com/' class='bbc_url' title='External link' rel='nofollow external'>http://www.ip-adress.com/"</a>)   InetGet($URL, @TempDir & "\IP.dat", 1)   ;Regular expression by:   ;<a href='http://www.geekzilla.co.uk/view0CBFD9A7-621D-4B0C-9554-91FD48AADC77.htm' class='bbc_url' title='External link' rel='nofollow external'>http://www.geekzilla.co.uk/view0CBFD9A7-621D-4B0C-9554-91FD48AADC77.htm</a>   $re = "\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"   $file = FileOpen(@TempDir & "\IP.dat", 0)   While 1     $line = StringLower(FileReadLine($file))     If @error = -1 Then       FileClose($file)       FileDelete(@TempDir & "\IP.dat")       ExitLoop     EndIf     $webIP = StringRegExpReplace($line, "[a-z]", "")     $IP = StringRegExp($webIP, $re, 2)     If (IsArray($IP)) Then       FileClose($file)       FileDelete(@TempDir & "\IP.dat")       Return $IP[0]     EndIf   WEnd EndFunc ;Get external IP from What Is My IP Address automation page. Func getExternalIP()   InetGet("<a href='http://www.whatismyip.com/automation/n09230945.asp' class='bbc_url' title='External link' rel='nofollow external'>http://www.whatismyip.com/automation/n09230945.asp"</a>, @TempDir & "\IP.dat", 1)   $IP = FileReadLine(@TempDir & "\IP.dat", 1)   FileDelete(@TempDir & "\IP.dat")   Return $IP EndFunc


Need more comments?! :)







#2 AdmiralClaws

AdmiralClaws

    Here be dragons

  • Active Members
  • PipPipPipPipPipPip
  • 4,649 posts

Posted 12 November 2009 - 07:07 PM

Awesome topic, five stars from me! :)

#3 trancexx

trancexx

    Queen F. Elizabeth MCXI

  • Active Members
  • PipPipPipPipPipPip
  • 6,119 posts

Posted 12 November 2009 - 07:26 PM

Liar :)
Yeah baby!

.
eMyvnE


#4 AdmiralClaws

AdmiralClaws

    Here be dragons

  • Active Members
  • PipPipPipPipPipPip
  • 4,649 posts

Posted 12 November 2009 - 08:11 PM

Whaaat? I thought all topics got awesome when YOU posted in them! :)
(HA got you now, there's no way you can deny that!)

Edited by AdmiralAlkex, 12 November 2009 - 08:15 PM.


#5 potemkin

potemkin

    Seeker

  • Normal Members
  • 1 posts

Posted 15 November 2009 - 11:12 AM

Good idea, nice code. Thanks for sharing.

#6 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 15 November 2009 - 11:27 AM

The getExternalIP is already done. _GetIP
But the other func is good :)

Edited by ProgAndy, 15 November 2009 - 11:29 AM.

*GERMAN* Posted Image [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users