Wednesday
May 17 2006
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.
Comments
supernice
by EvilBernd
Kann ich die Idee entleihen??
:-)
by jroger
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
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
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"
very very very nice blog
by loans canada
www.rittau.org is very great. I enjoyed your blog a lot. Thank you.