0rx

getWhois module for chatango bot

0rx
Mar 28th, 2015
930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. import os
  2. import re
  3. import random
  4. ##IP Whois
  5. ip_whois = dict()
  6. try:
  7.   f = open("ip_whois.txt", "r")
  8.   ip_whois = eval(f.read())
  9.   f.close()
  10. except:pass
  11.  
  12. ##SessionId Whois
  13. sid_whois = dict()
  14. try:
  15.   f = open("sid_whois.txt", "r")
  16.   sid_whois = eval(f.read())
  17.   f.close()
  18. except:pass
  19.  
  20.  
  21.  
  22. def whois(term, args):
  23.     uid = term
  24.     if len(uid) > 0:
  25.         pair = []
  26.         args = str(args)
  27.         if args not in uid: return None
  28.         for i in uid:
  29.           if i == args:
  30.             pass
  31.           else:
  32.             for z in uid[i]:
  33.               for g in uid[args]:
  34.                 if g == z and g != '':
  35.                   if i not in pair:
  36.                     pair.append(i)
  37.         if len(pair) > 0:
  38.           return (", ".join(pair))
  39.         else:
  40.           return None
  41.     else:
  42.       return None
  43.  
  44. #uid = {'orx':[44554455, 44334433, 33443344, 44334433], 'moth':[44334433, 22332233, 33223322], 'cole':[22332233,11221122], 'leo':[33443344, 44554455, 88778877], 'abs':[44554455, 88778877, 22332233]}
  45. #def getAlias(args):
  46. #    print("Currently known alias(es) of %s : %s."% (args.title(), whois(args)))
Advertisement
Add Comment
Please, Sign In to add comment