From db74a28c3aa08187aeb287ccafadbc6d0d0dee69 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 13 Sep 2016 23:43:07 +0200 Subject: [PATCH] Removed obsolete files --- hearthstone.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 hearthstone.py diff --git a/hearthstone.py b/hearthstone.py deleted file mode 100644 index dbbf2f74..00000000 --- a/hearthstone.py +++ /dev/null @@ -1,29 +0,0 @@ -import filemanager -import requests - -# Per far funzionare questa libreria serve un file "hearthstoneapi.txt" con l'API key ricevuta da mashape.com -apikey = filemanager.readfile('hearthstoneapi.txt') - - -def card(name): - headers = { - 'X-Mashape-Key': apikey - } - parametri = { - 'locale': 'itIT' - } - # TODO: Controllare che questo non sia exploitabile per un XSS o roba del genere. Anche se dubito. - r = requests.get("https://omgvamp-hearthstone-v1.p.mashape.com/cards/" + name, - params=parametri, headers=headers) - if r.status_code != 404: - return r.json() - else: - parametri = { - 'locale': 'enUS' - } - r = requests.get("https://omgvamp-hearthstone-v1.p.mashape.com/cards/search/" + name, - params=parametri, headers=headers) - if r.status_code != 404: - return r.json() - else: - raise ValueError("La carta non esiste!")