Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.
UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.
Python:BotSottile/ip.py
#!/usr/bin/env python import web, re def f_tor(self, origin, match, args): uri = match.group(1) info = web.get('http://toolserver.org/~krimpet/torcheck.php?ip=' + web.urllib.quote(uri)) if 'is not on the Tor network.' in info: result = '_negative_' else: result = '*positive* ( ' + 'http://toolserver.org/~krimpet/torcheck.php?ip=' + web.urllib.quote(uri) + ' )' self.msg(origin.sender, 'Tor check for ' + uri + ': ' + result) f_tor.rule = (['tor'], r'(.*)') f_tor.thread = True def f_proxy(self, origin, match, args): uri = match.group(1) info = web.get('http://whatismyipaddress.com/staticpages/index.php/lookup-results?ip=' + web.urllib.quote(uri)) result = re.compile("<TD>Proxy:</TD><TD>(<font color=red>)?([^<]+)(</font>)?</TD>").search(info).group(2) self.msg(origin.sender, 'Proxy check for ' + uri + ': ' + result) f_proxy.rule = (['proxy'], r'(.*)') f_proxy.thread = True def f_location(self, origin, match, args): uri = match.group(1) info = web.get('http://www.ip-adress.com/ip_tracer/?QRY=' + web.urllib.quote(uri)) r1 = re.compile('<th>IP address state:</th>\s+<td>([^<]+)</td>') r2 = re.compile('<th>IP address city:</th>\s+<td>([^<]+)</td>') r3 = re.compile('<th>IP address country:</th>\s+<td>\s+<img src="/flags/[^"]+.png" alt="ip address flag">\s+([\w\s]+?)\s+</td>') r4 = re.compile('<th>Host of this IP: \[<a href="/host" target="_self">\?</a>\]:</th>\s+<td>\s+([^\s]+)\s+<a href="[^"]+">\[Whois\]</a>\s+</td>') regex = (('Country', r3), ('State', r1), ('City', r2), ('Host', r4)) result = '' for e, r in regex: s = r.search(info) if s: if not result == '': result += ' - ' + e + ': ' + s.group(1) else: result = e + ': ' + s.group(1) if result == '': result = 'No results' self.msg(origin.sender, 'Location of ' + uri + ': ' + result + ' (' + 'http://www.ip-adress.com/ip_tracer/?QRY=' + web.urllib.quote(uri) + ')') f_location.rule = (['location'], r'(.*)') f_location.thread = True #