Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif cmd == "gis" and len(args) > 0: ##new by thelorgorenk
- 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 , <f x1233FFFF='1'>I <f x12F00='1'>Found: %s" % (sntonick(user.name), link), True)
- except Exception as e:
- room.message("%s Sorry i can't Find it %s :|" % (sntonick(user.name), args), True)
- print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement