Merge branch 'master' of /home/neale/public_html/repos/firebot

This commit is contained in:
Neale Pickett 2008-10-08 10:14:38 -06:00
commit 08802c0c55
2 changed files with 34 additions and 13 deletions

View File

@ -11,6 +11,10 @@ import os
import time
import socket
import rp
import random
import webretriever
webretriever.proxy = ('proxyout.lanl.gov', 8080)
def esc(arg):
return "'" + arg.replace("'", r"'\''") + "'"
@ -72,6 +76,16 @@ class Arsenic(firebot.FireBot, ProcBot):
lag))
def pii(self, sender, forum, addl, match):
ssns = []
for i in range(10):
ssns.append('%03d-%02d-%04d' % (random.randint(1, 999),
random.randint(1, 99),
random.randint(1, 9999)))
forum.msg('Security incident! %s' % ' '.join(ssns))
bindings.append((re.compile(r'^pii$'),
pii))
bindings.extend(firebot.FireBot.bindings)
##

View File

@ -7,11 +7,18 @@ import socket
resolver = adns.init()
proxy = None
class WebRetriever(asynchat.async_chat):
def __init__(self, url, body_cb):
asynchat.async_chat.__init__(self)
self.body_cb = body_cb
self.url = url
if proxy:
self.host, self.port = proxy
self.query = ''
self.fragment = ''
self.path = url
else:
(self.scheme,
self.netloc,
self.path,