Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Gis
- if cmd == "gis":
- try:
- search = args.split()
- import urllib.request
- with urllib.request.urlopen("http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s" % "+".join(search)) as url:
- udict = url.read().decode()
- a = re.finditer('"unescapedUrl":"(.+?)","url":"', udict)
- matches = []
- for match in a:
- match = str(match.group(1))
- matches.append(match)
- link = random.choice(matches)
- try:
- link = link.replace("https", "http")
- except:
- print("Random choice isn't SSL.")
- if args: room.message("%s, I found: %s" % (sntonick(user.name), link), True)
- except:
- room.message("%s I'm sorry, I was unable to find anything for search term: %s :|" % (str(user.name), args), True)
- ##Fax
- if cmd == "fax":
- try:
- name, body = args.split(" ", 1)
- l = "http://ch.besaba.com/mty.htm?"+room.name+"!"
- if name in self.roomnames :
- 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)
- room.message("Sent")
- else:
- room.message("I haven't joined that room")
- except:room.message("error")
- ##Wl
- if "^wl me" == message.body:
- if user.name not in whitelist:
- whitelist.append(user.name)
- room.message(user.name+" can use me now.")
- else:
- room.message("You're already in whitelist :|")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement