| View previous topic :: View next topic |
| Author |
Message |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sat Dec 31, 2005 3:30 pm Post subject: Ripe |
|
|
Was looking for a tcl that would perform a Ripe lookup on an ip address and show the info for that ip according to the ripe database.
http://www.ripe.net/whois
Thanks |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 31, 2005 6:00 pm Post subject: |
|
|
no need to parse web output
simply connect to WHOIS server on port 43:
| Code: |
set s [socket whois.ripe.net 43]
puts $s domain.com; flush $s
set data [read $s]
|
(this thing works because you [flush] the blocking socket and the server then dumps back to you its output which is captured by [read]) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sat Dec 31, 2005 6:20 pm Post subject: |
|
|
forgive my stupidness but is this a tcl script i can load into my egg. I wanted to do a !whois ipaddy and the bot respond with the ripe info.
Happy new year by the way :) |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Dec 31, 2005 6:23 pm Post subject: |
|
|
If you want your bot to respond to a public command a TCL script is the thing you will want to have as long you don't want to compile a C module.
I am pretty sure there are already some whois scripts around. Most do dns lookups, but if they use the "whois" tool you can always add a dnslookup before this query. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 31, 2005 6:37 pm Post subject: |
|
|
| martpen69 wrote: | forgive my stupidness but is this a tcl script i can load into my egg. I wanted to do a !whois ipaddy and the bot respond with the ripe info.
Happy new year by the way  |
| Code: |
bind pub o !whois foo
proc foo {n u h c t} {
set s [socket whois.ripe.net 43]
puts $s $t; flush $s
foreach line [split [read $s] \n] {
puthelp "privmsg $c :$line"
}
close $s
}
|
_________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sat Dec 31, 2005 7:11 pm Post subject: |
|
|
in channel i do
!whois myipaddy
and i get the result but the ip address i input seems to never get parsed to the query database/engine.
the following is part of what i get. In total i get about 50 of info but its all the same info because of the ip addy.
% Information related to '0.0.0.0 - 255.255.255.255'
inetnum: 0.0.0.0 - 255.255.255.255
netname: IANA-BLK
descr: The whole IPv4 address space
Thanks in advance for your time. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 31, 2005 7:28 pm Post subject: |
|
|
that means your IP does not belong to a network registered with RIPE
try whois.arin.net _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
martpen69 Voice
Joined: 20 Jun 2005 Posts: 32
|
Posted: Sat Dec 31, 2005 7:34 pm Post subject: |
|
|
Thank you very much all working
Thanks
:) |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Sat Dec 31, 2005 9:35 pm Post subject: |
|
|
for auto choosing whois server you could use [exec whois $t] (if you are not using windrop without cygwin) ^-^ _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
|