plugins/disabled/domain_plugin.py
author Mikael Berthe <mikael@lilotux.net>
Tue, 01 May 2007 12:26:35 +0200
changeset 0 93b25987d3e5
child 17 069f7fd5545d
permissions -rwxr-xr-x
Initial Mercurial repository Imported from Neutron' svn, with a few changes

#$ neutron_plugin 01

import rwhois

def handler_domain_domain(type, source, parameters):
	rec = rwhois.WhoisRecord(parameters)
	try:
		rec.whois()
		reply = 'Registered'
	except 'NoSuchDomain', reason:
		reply = 'AVAILABLE'
	except socket.error, (ecode,reason):
		reply = 'Socket Error'
	except "TimedOut", reason:
		reply = 'Timed Out'
	smsg(type, source, reply)

register_command_handler(handler_domain_domain, '!domain', 0, 'Returns information on specified domain.', '!domain <domain>', ['!domain jabber.org'])