Deck Viewer for Pro Tour coverage

The Pro Tour video coverage is nice, although there is one thing that has been nagging at me for a while: The cards are hard to recognize. While this was ok, when I still recognized the cards by image, it was rather difficult with the Pro Tour Prague coverage, since I didn't know most Dissension cards and am still struggling with some Guildpact cards. Therefore I created a Deck Viewer that allows a visual representation of Magic decks as shown on www.wizards.com. Just enter an URL (I suggest http://www.wizards.com/default.asp?x=mtgevent/ptpra06/t8decks) with deck lists and it will show a visual overview of the deck (currently without sideboard).

At the moment the page looks rather ugly and has several shortcomings. This is mostly because this is more of a proof of concept (one hour hack) and an idea I would like to pitch to Wizards. Nevertheless I would like to hear about bugs or improvement suggestions.


supernice
by EvilBernd
Friday, 19 May 2006 11:46

Kann ich die Idee entleihen??

:-)


by jroger
Friday, 19 May 2006 13:01

Klar, kannst auch den Code haben, wenn du willst. Ich habe noch Hoffnung, dass WotC sich die Idee evtl. entleiht. Hab sie jedenfalls angeschrieben ...


Code
by EvilBernd
Saturday, 20 May 2006 06:18

Ich kann nur PHP und denke mal, du fährst mit anderem Kraftstoff. Was mich interessiert wäre die Methode, mit der aus Kartennamen Wizards-freundliche Kartennamen gemacht werden, um deren Bilder zu nutzen.


by jroger
Saturday, 20 May 2006 23:11

Hier ist die Pythonmethod. Im Wesentlichen ein paar Buchstabenersetzungen, alles in Kleinbuchstaben wandeln, URL vornedran, fertig.

def _card_name_to_image_url(self, cardname):
    """
    Return the URL for the image of the supplied card.
    """

    cardname = cardname.lower()
    cardname = cardname.replace(" ", "_")
    cardname = cardname.replace("-", "_")
    cardname = cardname.replace(",", "")
    cardname = cardname.replace("'", "")
    cardname = cardname.replace("/", "__")

    return "http://www.wizards.com/global/images/magic/general/" + cardname + ".jpg"