Skip to content

Commit

Permalink
fix(patreon): use patreon api
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Sep 30, 2023
1 parent cbbd6c0 commit 7a4b7d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,15 @@ def update_patreon():
Get patron count from Patreon.
"""
print('Updating Patreon data...')
patreon_url = 'https://www.patreon.com/LizardByte'
# patreon_url = 'https://www.patreon.com/LizardByte'
patreon_url = 'https://www.patreon.com/api/campaigns/6131567'

response = s.get(url=patreon_url)

data = dict(
patron_count=int(re.search(r'\"patron_count\":\s(\d+)', response.text).group(1))
)
# data = dict(
# patron_count=int(re.search(r'\"patron_count\":\s(\d+)', response.text).group(1))
# )
data = response.json()['data']['attributes']

file_path = os.path.join('patreon', 'LizardByte')
write_json_files(file_path=file_path, data=data)
Expand Down

0 comments on commit 7a4b7d9

Please sign in to comment.