Skip to content

Commit

Permalink
Track download clicks
Browse files Browse the repository at this point in the history
This should allow us to also see when and where download was initiated.
  • Loading branch information
impaktor committed Jun 16, 2024
1 parent cd7e003 commit 8242de0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion make-downloadlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
url = asset['browser_download_url']
date = asset['updated_at'][0:10]
size = "{0:.2f}".format(asset['size'] / 1024 / 1024)
print(f'<li><a href="{url}">{name}</a> ({date} · {size} MB)</li>')

label = "unknown"
for dist in {"linux", "win", "app"}:
if dist in name.lower():
label = dist

print(f'<li><a data-umami-event="Downloaded {date} ({label})" href="{url}">{name}</a> ({date} · {size} MB)</li>')
print('</ul>')
print(f'<p>{body}</p>')

0 comments on commit 8242de0

Please sign in to comment.