Permalink
Browse files

Get MTG Image

  • Loading branch information...
minimaxir committed Sep 25, 2017
1 parent c2e4b6b commit c92440cd459640da9346cf31a79e768ac8641ea9
Showing with 6 additions and 0 deletions.
  1. +6 −0 utils.py
View
@@ -3,6 +3,8 @@
from secrets import *
GIPHY_API_URL = "https://api.giphy.com/v1/gifs/random?api_key={}&tag={}"
GATHERER_URL = "http://gatherer.wizards.com/Handlers/Image.ashx" \
"?multiverseid={}&type=card"
def get_gif(name, GIPHY_API_KEY=GIPHY_API_KEY, max_attempts=10):
@@ -17,3 +19,7 @@ def get_gif(name, GIPHY_API_KEY=GIPHY_API_KEY, max_attempts=10):
return gif['image_mp4_url']
attempts += 1
time.sleep(1)
def get_mtg_image(id):
return GATHERER_URL.format(id)

0 comments on commit c92440c

Please sign in to comment.