This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
martpen69
Voice
Posts: 32 Joined: Mon Jun 20, 2005 3:56 pm
Post
by martpen69 » Sat Dec 31, 2005 3:30 pm
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
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sat Dec 31, 2005 6:00 pm
no need to parse web output
simply connect to WHOIS server on port 43:
Code: Select all
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
martpen69
Voice
Posts: 32 Joined: Mon Jun 20, 2005 3:56 pm
Post
by martpen69 » Sat Dec 31, 2005 6:20 pm
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 :)
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Sat Dec 31, 2005 6:23 pm
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...
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sat Dec 31, 2005 6:37 pm
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: Select all
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
martpen69
Voice
Posts: 32 Joined: Mon Jun 20, 2005 3:56 pm
Post
by martpen69 » Sat Dec 31, 2005 7:11 pm
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.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Sat Dec 31, 2005 7:28 pm
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
martpen69
Voice
Posts: 32 Joined: Mon Jun 20, 2005 3:56 pm
Post
by martpen69 » Sat Dec 31, 2005 7:34 pm
Thank you very much all working
Thanks
:)
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Sat Dec 31, 2005 9:35 pm
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...