Xenobiologist Posted March 30, 2008 Share Posted March 30, 2008 Hi, does this also work for you? I can only test it for my provider. #include<Array.au3> #include<Inet.au3> Global $my_WAN_IP = _GetIP() If @error Then ConsoleWrite(@error & @CRLF) ConsoleWrite('! : ' & $my_WAN_IP & @CRLF) Global $my_Provider_A = _getProvider($my_WAN_IP) _ArrayDisplay($my_Provider_A) Func _getProvider($ip) Local $provInfo[4], $fcontent, $re If Not StringRegExp($ip, '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', 0) Then SetError(1) Return -1 EndIf $fcontent = _INetGetSource('http://www.ip-adress.com/whois/' & $ip) If Not @error Then $re = StringRegExp($fcontent, '(?<=descr:).*(?=\n)', 3) If @error = 0 Then $provInfo[0] = StringStripWS($re[0], 1) $provInfo[1] = StringStripWS($re[1], 1) EndIf $re = StringRegExp($fcontent, '(?<=inetnum:)[\d .-]*(?=\n)', 3) If @error = 0 Then $provInfo[2] = StringStripWS($re[0], 1) $re = StringRegExp($fcontent, '(?<=country:).*(?=\n)', 3) If @error = 0 Then $provInfo[3] = StringStripWS($re[0], 1) Return $provInfo EndIf SetError(2) Return -1 EndFunc ;==>_getProvider Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
speedy6 Posted March 30, 2008 Share Posted March 30, 2008 Yep it works: Belgium : Belgacom/Skynet Link to comment Share on other sites More sharing options...
ptrex Posted March 30, 2008 Share Posted March 30, 2008 @Xenobiologist Great works like a charm !! regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Swift Posted March 30, 2008 Share Posted March 30, 2008 Didn't work for me... I got: Row [0] [1] [2] [3] Link to comment Share on other sites More sharing options...
monoceres Posted March 30, 2008 Share Posted March 30, 2008 Works for me (Telia, Sweden), just curious though, what does the ip range in $array[2] mean? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
mads3n Posted March 30, 2008 Share Posted March 30, 2008 Works for me (Telia, Sweden), just curious though, what does the ip range in $array[2] mean?my guess is that it is the ip range the provider owns, and distributes among the customers.. Mads3n.dk Link to comment Share on other sites More sharing options...
ResNullius Posted March 30, 2008 Share Posted March 30, 2008 Fails for me: returns empty array. It does ConsoleWrite my Wan IP OK, but that's it. I also tested wiyh my provider's IP and it fails too. So if you want to test with that it's 216.113.192.10 Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 30, 2008 Author Share Posted March 30, 2008 (edited) Hi, thanks @all for testing. The problem is finding a website which porvides good information. Maybe I have to add some extra StringRegExp for special things. Mega Edited March 30, 2008 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
microsoft Posted March 30, 2008 Share Posted March 30, 2008 Thanks Link to comment Share on other sites More sharing options...
DirtDBaK Posted March 31, 2008 Share Posted March 31, 2008 I tested it on a Sprint PCS broadband card and it didn't return any values still looks neat though! [center][/center] Link to comment Share on other sites More sharing options...
GEOSoft Posted March 31, 2008 Share Posted March 31, 2008 It didn't work for m but I managed to get it working by removing the RegEx and replacing it with a string split then an array search. It was easy to check yours by checking the arrays after each reex. That bloody fuction is getting severly overused anyway. 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 More sharing options...
Xenobiologist Posted March 31, 2008 Author Share Posted March 31, 2008 Hi, fot those where the function didn't return correct values, please visit the site used in the func and do a test manually and then tell me whether the information provided is correct there. After that I can add then additional RegExp to get the information even if there isn't a descr. string. Thanks! Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GEOSoft Posted March 31, 2008 Share Posted March 31, 2008 Hi,fot those where the function didn't return correct values, please visit the site used in the func and do a test manually and then tell me whether the information provided is correct there. After that I can add then additional RegExp to get the information even if there isn't a descr. string.Thanks!MegaIt worked fine from the site and like I said, I was able to get the info by using stringsplit instead. 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 More sharing options...
Xenobiologist Posted March 31, 2008 Author Share Posted March 31, 2008 It worked fine from the site and like I said, I was able to get the info by using stringsplit instead.Hi,but what info did you collect? Can you show me? What the site respond and what you need from that.Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
GEOSoft Posted March 31, 2008 Share Posted March 31, 2008 (edited) Hi, but what info did you collect? Can you show me? What the site respond and what you need from that. Mega#include<Array.au3> #include<Inet.au3> Global $my_WAN_IP = _GetIP() If @error Then ConsoleWrite(@error & @CRLF) ConsoleWrite('! : ' & $my_WAN_IP & @CRLF) ;Global $my_Provider_A = _getProvider($my_WAN_IP) $arr = StringSplit(_INetGetSource('http://www.ip-adress.com/whois/' & $my_WAN_IP), @LF) ;_ArrayDisplay($my_Provider_A) _ArrayDisplay($arr) Func _getProvider($ip) Local $provInfo[4], $fcontent, $re If Not StringRegExp($ip, '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', 0) Then SetError(1) Return -1 EndIf $fcontent = _INetGetSource('http://www.ip-adress.com/whois/' & $ip) If Not @error Then $re = StringRegExp($fcontent, '(?<=descr:).*(?=\n)', 3) If @error = 0 Then $provInfo[0] = StringStripWS($re[0], 1) $provInfo[1] = StringStripWS($re[1], 1) EndIf $re = StringRegExp($fcontent, '(?<=inetnum:)[\d .-]*(?=\n)', 3) If @error = 0 Then $provInfo[2] = StringStripWS($re[0], 1) $re = StringRegExp($fcontent, '(?<=country:).*(?=\n)', 3) If @error = 0 Then $provInfo[3] = StringStripWS($re[0], 1) Return $provInfo EndIf SetError(2) Return -1 EndFunc ;==>_getProvider Then just use _ArraySearch to get the start and end positions. After that you can work out a RegEx or RegExReplace that only works on those lines. By the way, all I'm pointing out here is that the site returns the proper results but your function fails for me. Edited March 31, 2008 by GEOSoft 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 More sharing options...
Toady Posted March 31, 2008 Share Posted March 31, 2008 Seems to work here www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
GEOSoft Posted March 31, 2008 Share Posted March 31, 2008 Interesting why it works for some and not others. I just sent him the results that show the html source was returned properly by _InetGetSource, so the only place left for it to fail is in the RegEx(). He may have to get test pages from more than one person to find out where it's really failing. 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 More sharing options...
Moderators SmOke_N Posted April 1, 2008 Moderators Share Posted April 1, 2008 (edited) Some are asking why it's working on some PC's and not others. I doubt seriously it will work on most U.S. PC's because of the source content I was reading over (U.S. versus a lot of other countries). I was looking for a tool that could narrow down searches, and if this was application specific, then you probably don't need to check but once a day maybe. I found a site that seemed to give what "I" was looking for, but I reached my daily limit before debugging... Then I registered and just didn't feel like messing with it any more. If someone else would like to finish debugging be my guest. #include<Array.au3> #include<Inet.au3> $aArray = _myGetProvider("") _ArrayDisplay($aArray) Func _myGetProvider($nIP = "") If $nIP = "" Then $aSRE = StringRegExp(_INetGetSource("http://www.aboutmyx.com/AboutMyXApp/AboutMyIP.jsp"), _ "(?s)(?i)Your IP Address: (\d+\.\d+\.\d+\.\d+)<", 1) If IsArray($aSRE) = 0 Then Return SetError(1, 0, 0) $nIP = $aSRE[0] EndIf ;[1] IP, [2] Provider, [3] Country, [4] City Local $aReturn[5] = [4, $nIP] Local $sSource = _INetGetSource("http://whois.domaintools.com/" & $nIP) Local $sLookUp = '<img src="http://img.domaintools.com/flags/.*?" alt=".*?" height="\d+" width="\d+">' Local $sExp = ".*?(\w+\s\w*|\w+)\s{2,}(\w+\s\w*|\w+)\s*(\w+\s\w+|\w+).*?<" Local $aSRE = StringRegExp($sSource, "(?s)(?i)" & $sLookUp & $sExp, 1) If IsArray($aSRE) = 0 Then Return SetError(2, 0, $aReturn) $aReturn[2] = $aSRE[1] $aReturn[3] = $aSRE[0] $aReturn[4] = $aSRE[2] Local $aProvider = StringRegExp($sSource, "(?s)(?i)orgname:(.*?)<|descr:(.*?)<", 1) If IsArray($aProvider) = 0 Then Return SetError(3, 0, $aReturn) If StringInStr(StringReplace($aProvider[0], " ", ""), $aSRE[2]) Then $aReturn[2] = $aSRE[2] $aReturn[4] = $aSRE[1] MsgBox(0,0,0) EndIf Return $aReturn EndFunc Edit: Damn.. I left someones IP address in the param pass (removed) Edited April 1, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
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