egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ripe

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sat Dec 31, 2005 3:30 pm    Post subject: Ripe Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 31, 2005 6:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sat Dec 31, 2005 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Dec 31, 2005 6:23 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 31, 2005 6:37 pm    Post subject: Reply with quote

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 Smile


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
View user's profile Send private message Visit poster's website
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sat Dec 31, 2005 7:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 31, 2005 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
martpen69
Voice


Joined: 20 Jun 2005
Posts: 32

PostPosted: Sat Dec 31, 2005 7:34 pm    Post subject: Reply with quote

Thank you very much all working

Thanks

:)
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sat Dec 31, 2005 9:35 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber