Advertisement
Thelorgoreng

Akmal :'v

Oct 5th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.68 KB | None | 0 0
  1. ##Gis
  2. if cmd == "gis":
  3.         try:
  4.             search = args.split()
  5.             import urllib.request
  6.             with urllib.request.urlopen("http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s" % "+".join(search)) as url:
  7.                 udict = url.read().decode()
  8.             a = re.finditer('"unescapedUrl":"(.+?)","url":"', udict)
  9.             matches = []
  10.             for match in a:
  11.                 match = str(match.group(1))
  12.                 matches.append(match)
  13.             link = random.choice(matches)
  14.             try:
  15.                 link = link.replace("https", "http")
  16.             except:
  17.                 print("Random choice isn't SSL.")
  18.             if args: room.message("%s, I found: %s" % (sntonick(user.name), link), True)
  19.         except:
  20.             room.message("%s I'm sorry, I was unable to find anything for search term: %s :|" % (str(user.name), args), True)
  21.  
  22. ##Fax
  23. if cmd == "fax":
  24.         try:
  25.           name, body = args.split(" ", 1)
  26.           l = "http://ch.besaba.com/mty.htm?"+room.name+"!"
  27.           if name in self.roomnames :
  28.             self.getRoom(name).message('[<font color="#6699CC"><b>Message</b></font> - %s ] in <a href=\"%s" target=\"_blank\"><u>%s</u></a> : <font color="#66FFFF"><i> %s <i></font>' % (sntonick(user.name), l, room.name, body),True)
  29.             room.message("Sent")
  30.           else:
  31.             room.message("I haven't joined that room")
  32.         except:room.message("error")
  33.  
  34. ##Wl
  35. if "^wl me" == message.body:
  36.       if user.name not in whitelist:
  37.         whitelist.append(user.name)
  38.         room.message(user.name+" can use me now.")
  39.       else:
  40.         room.message("You're already in whitelist :|")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement