Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Nov 2, 2023
1 parent 79695b0 commit aa6175d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/get_enchant_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
36503,
162426,
172938,
409669,
409671,
409672,
]

def scrape(path, pattern):
Expand Down
5 changes: 5 additions & 0 deletions scripts/get_hearthstone_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ def scrape(path, pattern):
sys.stderr.write('No itemIDs found\n')
sys.exit(1)

sys.stderr.write(f'Scraping done, processing {len(itemIDs)} items...\n')
curIter = 1
for itemID in itemIDs:
if int(itemID) in hearthstoneIDs:
continue

itemName = scrape(f'item={itemID}', r'<title>(.*) - Item - ') # bit wasteful
hearthstoneIDs[int(itemID)] = itemName[0]

sys.stderr.write(f'{curIter}/{len(itemIDs)}\n')
curIter = curIter + 1

print('-- generated by scripts/get_hearthstone_ids.py')
print('local _, addon = ...')
print('addon.HEARTHSTONE_IDS = {')
Expand Down

0 comments on commit aa6175d

Please sign in to comment.