razor999 Posted April 17, 2011 Posted April 17, 2011 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 )
bwochinski Posted April 17, 2011 Posted April 17, 2011 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] )
razor999 Posted April 17, 2011 Author Posted April 17, 2011 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
UEZ Posted April 17, 2011 Posted April 17, 2011 (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 April 17, 2011 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
guinness Posted April 17, 2011 Posted April 17, 2011 (edited) Another example to add to my take on Edited April 17, 2011 by guinness UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _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 parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
razor999 Posted April 17, 2011 Author Posted April 17, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now