Skip to content

Commit 5b710d9

Browse files
authored
Update __init__.py
1 parent 15a114c commit 5b710d9

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

GithubStat/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
5555
[-] Github URL : https://github.com/%s
5656
[-] Repositories : https://github.com/%s/repositories
57-
[-] Avatar : %s
57+
[-] Avaar : %s
5858
"""
5959

6060
def status(user):
61-
main = requests.get(f"https://api.github.com/users/{user}")
61+
main = requests.get("https://api.github.com/users/%s" % (user))
6262
if main.status_code == 200:
6363
pass
6464
elif main.status_code == 404:
@@ -70,7 +70,7 @@ def status(user):
7070

7171
def stats(user):
7272
status(user)
73-
main = requests.get(f"https://api.github.com/users/{user}")
73+
main = requests.get("https://api.github.com/users/%s" % (user))
7474
dump = json.loads(main.text)
7575

7676
h1 = dump['login']
@@ -92,7 +92,7 @@ def stats(user):
9292
print(info % (h1, h2, h3, h4, h5, h6, h7, h8,
9393
h9, h10, h11, h12, h13, h14, h1, h1, h15))
9494

95-
orgs = requests.get(f"https://api.github.com/users/{user}/orgs")
95+
orgs = requests.get("https://api.github.com/users/%s/orgs" % (user))
9696
orgs_dump = json.loads(orgs.text)
9797
for hulu in orgs_dump:
9898
print('[-] Organization : {} '.format(hulu['login']))
@@ -104,7 +104,7 @@ def stats(user):
104104
else: page_c = 1
105105

106106
for i in range(page_c):
107-
repos = requests.get(f"https://api.github.com/users/{user}/repos?page={i+1}&per_page=100")
107+
repos = requests.get("https://api.github.com/users/%s/repos?page=%s&per_page=100" % (user,i+1))
108108
repo_dump = json.loads(repos.text)
109109
for x in repo_dump:
110110
stats.append((x['name'],x['stargazers_count'],x['forks_count'],x['clone_url']))
@@ -120,11 +120,11 @@ def stats(user):
120120
print('')
121121

122122
if save_repo == "y" or save_repo == "Y":
123-
with open(f'{user}.csv','w', newline='', encoding='utf-8') as f:
123+
with open('%s.csv' % (user),'w', newline='', encoding='utf-8') as f:
124124
output=csv.writer(f)
125125
output.writerow(['Repository Name','Total Stars','Total Forks','Clone URL'])
126126
for w in stats: output.writerow(w)
127-
print(f'[-] File Saved as : {user}.csv')
127+
print("[-] File Saved as : %s.csv" % (user))
128128
print('')
129129
else:
130130
pass

0 commit comments

Comments
 (0)