-
Notifications
You must be signed in to change notification settings - Fork 55
/
main.py
29 lines (27 loc) · 819 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
try:
with open("status.md" , "r") as f:
text = f.readline()
num = [int(x) for x in text.split() if x.isdigit()][0]
num += 1
if num<= 1024:
with open("status.md" , 'w') as f:
if num in range(16):
img = "![pull-shark](images/pull-shark-default.png)"
elif num in range(128):
img = "![pull-shark](images/pull-shark-bronze.png)"
elif num in range(1024):
img = "![pull-shark](images/pull-shark-silver.png)"
else:
img = "![pull-shark](images/pull-shark-gold.png)"
f.write(f"{num} pull requests merged")
f.write("<br>")
f.write("Currently:")
f.write("<br>")
f.write(img)
except:
with open("status.md" , "w") as f:
f.write("1 pull request merged")
f.write("<br>")
f.write("Currently:")
f.write("<br>")
f.write("![pull-shark](images/pull-shark-default.png)")