Соберите колоды Hearthstone с сайта HearthPwn (http://hearthpwn.com), а затем создайте базу данных результатов SQLite. Также может очищать данные о сборе карточек из HearthPwn/Innkeeper (http://innkeeper.com) и интегрироваться с Mashape Hearthstone API от omgvamp (http://hearthstoneapi.com) для создания таблицы данных карточек, которую можно использовать для создания дополнительных расширенные запросы.
Требует lxml, cssselect и запрашивает пакеты. Их можно установить, открыв командную строку в папке Hearthstats и выполнив следующую команду:
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.
Прежде чем заполнять базу данных карточек, вы должны сначала зарегистрироваться для получения ключа API на Mashape.com. Получив ключ API, переименуйте config.ini.example в config.ini, если config.ini еще не существует, и откройте config.ini в текстовом редакторе (однократный запуск сценария также создаст пустой файл config.ini). :
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
Замените keygoeshere своим ключом API Mashape.
Прежде чем заполнять базу данных коллекции карточек, вы должны сначала синхронизировать свою коллекцию карточек с помощью Innkeeper. Затем войдите в свою учетную запись HearthPwn. Используя консоль разработки вашего веб-браузера (или другой инструмент просмотра файлов cookie), получите значение файла cookie Auth.Session. Получив значение Auth.Session, переименуйте config.ini.example в config.ini, если config.ini еще не существует, и откройте config.ini в текстовом редакторе (однократный запуск сценария также создаст пустой config.ini). файл):
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
Замените authsessiongoeshere на свое значение Auth.Session.