Sign in to follow this  
Followers 0
razor999

(HELP) show IP, Host name, City, Region

6 posts in this topic

hey all,

please help me finish this script.

I want to show all IP, region, city and etc

display did not work

someone please help me

#include <String.AU3>
#include <array.au3>


Global $Bin = InetRead ("http://www.find-ip-address.org/ip-location-lookup-module.php")
Global $Page = BinaryToString ($Bin)

$YourIP = _StringBetween ($Page, 'Your IP Number: <b>' , '</b></td></tr>')
$YourHostname = _StringBetween ($Page, 'Your Host name: <b>' , '</b></td></tr>')
$YourCity = _StringBetween ($Page, 'Your City: <b>' , '</b></td></tr>')
$YourRegion = _StringBetween ($Page, 'Your Region: <b>' , '</b></td></tr>')
$YourCapital = _StringBetween ($Page, 'Your Capital: <b>' , '</b></td></tr>')
$YourCountry = _StringBetween ($Page, 'Your Country Name: <b>' , '</b></td></tr>')
$IPOrganization = _StringBetween ($Page, 'IP Organization: <b>' , '</b></td></tr>')

msgbox (0, '' , $YourIP &@CRLF& $YourHostname &@CRLF& $YourCity &@CRLF& $YourRegion &@CRLF& $YourCapital &@CRLF& $YourCountry &@CRLF& $IPOrganization   )

Share this post


Link to post
Share on other sites



The _StringBetween() function returns an array, in the event that it finds more than a single match. In your case the basic issue is that you simply have to specify the first element of the array when outputting to the msgbox().

msgbox(0, '' , $YourIP[0] &@CRLF& $YourHostname[0] &@CRLF& $YourCity[0] &@CRLF& $YourRegion[0] &@CRLF& $YourCapital[0] &@CRLF& $YourCountry[0] &@CRLF& $IPOrganization[0]   )

Share this post


Link to post
Share on other sites

The _StringBetween() function returns an array, in the event that it finds more than a single match. In your case the basic issue is that you simply have to specify the first element of the array when outputting to the msgbox().

msgbox(0, '' , $YourIP[0] &@CRLF& $YourHostname[0] &@CRLF& $YourCity[0] &@CRLF& $YourRegion[0] &@CRLF& $YourCapital[0] &@CRLF& $YourCountry[0] &@CRLF& $IPOrganization[0]   )

thank you for your help

good luck today

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Try this:

Global $Bin = InetRead ("http://www.find-ip-address.org/ip-location-lookup-module.php")
Global $Page = BinaryToString ($Bin)

$YourIP = Grep($Page, "Your IP Number")
$YourHostname = Grep($Page, "Your Host name")
$YourCity =  Grep($Page, "Your City")
$YourRegion =  Grep($Page, "Your Region")
$YourCapital =  Grep($Page, "Your Capital")
$YourCountry =  Grep($Page, "Your Country Name")
$IPOrganization =  Grep($Page, "IP Organization")

msgbox (0, "IP location lookup" ,   "Your IP Number: " & @TAB & $YourIP & @LF & _
                                                            "Your Host name: " & @TAB & $YourHostname & @LF & _
                                                            "Your City: " & @TAB & @TAB & $YourCity & @LF & _
                                                            "Your Region: " & @TAB & $YourRegion & @LF & _
                                                            "Your Capital:  " & @TAB & $YourCapital & @LF & _
                                                            "Your Country Name: " & $YourCountry & @LF & _
                                                            "IP Organization: " & @TAB & $IPOrganization)
Func Grep($sString, $sSearch)
    Local $aGrep = StringRegExp($Page, "(?i)(?U)" & $sSearch & ": <b>(.*)</b>", 3)
    If @error Then Return SetError(@error, 0, 0)
    Return $aGrep[0]
EndFunc

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Another example to add to my take on

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Try this:

Global $Bin = InetRead ("http://www.find-ip-address.org/ip-location-lookup-module.php")
Global $Page = BinaryToString ($Bin)

$YourIP = Grep($Page, "Your IP Number")
$YourHostname = Grep($Page, "Your Host name")
$YourCity =  Grep($Page, "Your City")
$YourRegion =  Grep($Page, "Your Region")
$YourCapital =  Grep($Page, "Your Capital")
$YourCountry =  Grep($Page, "Your Country Name")
$IPOrganization =  Grep($Page, "IP Organization")

msgbox (0, "IP location lookup" ,   "Your IP Number: " & @TAB & $YourIP & @LF & _
                                                            "Your Host name: " & @TAB & $YourHostname & @LF & _
                                                            "Your City: " & @TAB & @TAB & $YourCity & @LF & _
                                                            "Your Region: " & @TAB & $YourRegion & @LF & _
                                                            "Your Capital:  " & @TAB & $YourCapital & @LF & _
                                                            "Your Country Name: " & $YourCountry & @LF & _
                                                            "IP Organization: " & @TAB & $IPOrganization)
Func Grep($sString, $sSearch)
    Local $aGrep = StringRegExp($Page, "(?i)(?U)" & $sSearch & ": <b>(.*)</b>", 3)
    If @error Then Return SetError(@error, 0, 0)
    Return $aGrep[0]
EndFunc

Br,

UEZ

thanks, nice script

Share this post


Link to post
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
Sign in to follow this  
Followers 0