From fc456d6660162f7ad3a278d00288865175b30281 Mon Sep 17 00:00:00 2001 From: Brian Sherson Date: Mon, 3 Jun 2013 19:14:03 -0700 Subject: Long-needed update --- mibbit.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 mibbit.py (limited to 'mibbit.py') diff --git a/mibbit.py b/mibbit.py new file mode 100644 index 0000000..73a929d --- /dev/null +++ b/mibbit.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +import re + +class Mibbit(object): + def onRecv(self, IRC, line, data): + if data==None: return + (origin, ident, host, cmd, target, params, extinfo)=data + if len(target) and target[0]!="#": + #print target + #print cmd + #print extinfo + target=IRC.user(target) + if cmd=="NOTICE" and target==IRC.identity: + matches=re.findall("^\\*\\*\\* CONNECT: Client connecting on port ([0-9]+) \\(class (.*?)\\): (.+)!([0-9a-f]{8})@(.+\\.mibbit\\.com) \\((.+)\\) \\[(.+)\\]$",extinfo) + #print matches + "*** REMOTECONNECT: Client connecting at hypocrisy.insomniairc.net: B!463df443@ircip4.mibbit.com (109.169.29.95) [rrcs-70-61-244-67.central.biz.rr.com]" + if matches: + (port, cls, nick, hexip, mibbithost, mibbitip, host)=matches[0] + IRC.raw("CHGHOST %s %s"%(nick, host)) + IRC.raw("CHGIDENT %s %s"%(nick, "mibbit")) + IRC.raw("CHGNAME %s %s"%(nick, "Mibbit User")) + return + matches=re.findall("^\\*\\*\\* REMOTECONNECT: Client connecting at (.+?): (.+)!([0-9a-f]{8})@(.+\\.mibbit\\.com) \\((.+)\\) \\[(.+)\\]$",extinfo) + #print matches + "*** REMOTECONNECT: Client connecting at hypocrisy.insomniairc.net: B!463df443@ircip4.mibbit.com (109.169.29.95) [rrcs-70-61-244-67.central.biz.rr.com]" + if matches: + (remotehost, nick, hexip, mibbithost, mibbitip, host)=matches[0] + IRC.raw("CHGHOST %s %s"%(nick, host)) + IRC.raw("CHGIDENT %s %s"%(nick, "mibbit")) + IRC.raw("CHGNAME %s %s"%(nick, "Mibbit User")) + return -- cgit v1.2.3