Updating the dog function to pull form reddit boards too
This commit is contained in:
parent
40fff529c7
commit
d3066f4d0d
@ -1,9 +1,11 @@
|
|||||||
import random
|
import random
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
import get_from_reddit
|
||||||
|
|
||||||
|
|
||||||
def get_dog():
|
def get_dog():
|
||||||
return random.choice([random_sheeb, random_dog])()
|
return random.choice([random_sheeb, random_dog, random_dog_reddit])()
|
||||||
|
|
||||||
|
|
||||||
def random_sheeb():
|
def random_sheeb():
|
||||||
@ -21,6 +23,21 @@ def random_dog():
|
|||||||
return "https://random.dog/{}".format(dog_url)
|
return "https://random.dog/{}".format(dog_url)
|
||||||
|
|
||||||
|
|
||||||
|
def random_dog_reddit():
|
||||||
|
return get_from_reddit.get_image(
|
||||||
|
[
|
||||||
|
'AustralianCattleDog',
|
||||||
|
'GSP',
|
||||||
|
'corgi',
|
||||||
|
'dogpictures',
|
||||||
|
'rarepuppers',
|
||||||
|
'tippytaps',
|
||||||
|
'vizsla',
|
||||||
|
'zoomies',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_birb():
|
def get_birb():
|
||||||
return "https://random.birb.pw/img/{}".format(
|
return "https://random.birb.pw/img/{}".format(
|
||||||
requests.get(
|
requests.get(
|
||||||
|
@ -22,9 +22,8 @@ def get_image(boards, nsfw=False):
|
|||||||
'i3.kym-cdn.com',
|
'i3.kym-cdn.com',
|
||||||
'imgur.com',
|
'imgur.com',
|
||||||
'media.giphy.com',
|
'media.giphy.com',
|
||||||
'my.mixtape.moe',
|
|
||||||
]
|
]
|
||||||
|
print("chose %s" % boards)
|
||||||
request_string = "https://reddit.com/r/{}/random.json".format(boards)
|
request_string = "https://reddit.com/r/{}/random.json".format(boards)
|
||||||
|
|
||||||
if not nsfw:
|
if not nsfw:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user