import random import glob import requests import get_from_reddit def get_red_panda(): red_panda = None while not red_panda: red_panda = requests.get("https://some-random-api.ml/img/red_panda").json()[ "link" ] return red_panda def get_dog(): # return random.choice([random_sheeb, random_dog, random_dog_reddit])() return random_dog_reddit() def random_sheeb(): return requests.get("http://shibe.online/api/shibes?count=1&urls=true").json()[0] def random_dog(): dog_url = None while not dog_url: dog_url = requests.get("https://dog.ceo/api/breeds/image/random").json()[ "message" ] return dog_url def random_dog_reddit(): return get_from_reddit.get_image( [ "AustralianCattleDog", "GSP", "corgi", "dogpictures", "rarepuppers", "tippytaps", "vizsla", "zoomies", "shiba", "swedishvallhund", "puppy101", "lookatmydog", "jackrussellterrier", ] ) def dale(): return random.choice(glob.glob("/tmp/dale/*")) def cowboy(): return random.choice( ["https://i.imgur.com/RAFfsk7.png", "https://i.imgur.com/Ppse2ic.jpg"] )