Extraiga los mazos de Hearthstone de HearthPwn (http://hearthpwn.com) y luego cree una base de datos SQLite de los resultados. También puede extraer datos de recopilación de tarjetas de HearthPwn/Innkeeper (http://innkeeper.com) y se integra con la API Mashape Hearthstone de omgvamp (http://hearthstoneapi.com) para crear una tabla de datos de tarjetas que se puede usar para hacer más consultas avanzadas.
Requiere paquetes lxml, cssselect y solicitudes. Estos se pueden instalar abriendo un símbolo del sistema en la carpeta hearthstats y ejecutando el siguiente comando:
pip install -r requirements.txt
usage: hearth.py [-h] [--buildcards] [--builddecks] [--buildcollection]
[--perclass] [--count COUNT] [--filtering FILTERING]
[--sorting SORTING] [--patch PATCH] [--results]
Scrape Hearthstone decks from HearthPwn (http://hearthpwn.com), then build a
SQLite database of the results. Can also scrape card collection data from
HearthPwn/Innkeeper (http://innkeeper.com), and integrates with omgvamp's
Mashape Hearthstone API (http://hearthstoneapi.com) to build a table of card
data that can be used to make more advanced queries.
optional arguments:
-h, --help show this help message and exit
--buildcards build card database from Mashape
--builddecks build deck database from HearthPwn
--buildcollection build personal card collection from Hearthpwn
--perclass get the same number of decks for each class
--count COUNT number of decks to retrieve (per class, if --perclass
is set)
--filtering FILTERING
the HearthPwn filter used when finding decks, as seen
in the HearthPwn URL
--sorting SORTING the HearthPwn sorting used when finding decks, as seen
in the HearthPwn URL after "&sort="
--patch PATCH the HearthPwn patch ID used when finding decks, as
seen in the HearthPwn URL after "&filter-build="
--results for all cards, display (in a CSV-ish format) the:
cardname, hero (or neutral), total count of decks
using the card, percentage of decks using the card,
average count of the card in decks using it, and the
count of the card in your collection.
Antes de completar la base de datos de la tarjeta, primero debe registrarse para obtener una clave API en Mashape.com. Una vez que tenga su clave API, cambie el nombre de config.ini.example a config.ini si config.ini aún no existe y abra config.ini en un editor de texto (al ejecutar el script una vez también se creará un archivo config.ini en blanco). :
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
Reemplace keygoeshere con su clave API de Mashape.
Antes de completar la base de datos de la colección de tarjetas, primero debe sincronizar su colección de tarjetas con Innkeeper. Luego, inicia sesión en tu cuenta HearthPwn. Utilizando la consola de desarrollo de su navegador web (u otra herramienta de visualización de cookies), obtenga el valor de la cookie Auth.Session. Una vez que tenga su valor Auth.Session, cambie el nombre de config.ini.example a config.ini si config.ini aún no existe y abra config.ini en un editor de texto (al ejecutar el script una vez también se creará un config.ini en blanco). archivo):
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
Reemplace authsessiongoeshere con su valor Auth.Session.