HearthPwn(http://hearthpwn.com)에서 하스스톤 데크를 스크랩한 다음 결과에 대한 SQLite 데이터베이스를 구축합니다. 또한 HearthPwn/Innkeeper(http://innkeeper.com)에서 카드 수집 데이터를 스크랩하고 omgvamp의 Mashape Hearthstone API(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.
카드 데이터베이스를 채우기 전에 먼저 Mashape.com에서 API 키를 등록해야 합니다. API 키가 있으면 config.ini가 아직 없으면 config.ini.example의 이름을 config.ini로 바꾸고 텍스트 편집기에서 config.ini를 엽니다. 스크립트를 한 번 실행하면 빈 config.ini 파일도 생성됩니다. :
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
keygoehere를 Mashape API 키로 바꾸세요.
카드 컬렉션 데이터베이스를 채우기 전에 먼저 Innkeeper를 사용하여 카드 컬렉션을 동기화해야 합니다. 그런 다음 HearthPwn 계정에 로그인하세요. 웹 브라우저의 개발 콘솔(또는 다른 쿠키 보기 도구)을 사용하여 Auth.Session 쿠키 값을 가져옵니다. Auth.Session 값이 있으면 config.ini가 아직 존재하지 않는 경우 config.ini.example의 이름을 config.ini로 바꾸고 텍스트 편집기에서 config.ini를 엽니다. 스크립트를 한 번 실행하면 빈 config.ini가 생성됩니다. 파일):
[Configuration]
mashapekey = keygoeshere
authsession = authsessiongoeshere
authsessiongoeshere를 Auth.Session 값으로 바꿉니다.