generated from gayanvoice/github-profile-views-counter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
repolist.py
30 lines (22 loc) · 613 Bytes
/
repolist.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
30
import json
import requests
import os
username = "Sabyasachi-Seal"
request = requests.get('https://api.github.com/users/'+username+'/repos')
jsonfile = request.json()
file = open('./config.json', 'r')
readfile = file.read()
file.close()
data = json.loads(readfile)
newdata = []
for i in range(0,len(jsonfile)):
newdata.append(jsonfile[i]['name'])
data['repository'] = newdata
jsondump = json.dumps(data)
file = open('./config.json', 'w')
file.write(jsondump)
file.close()
print("Updated Repository List")
os.system('git add .')
os.system('git commit -m "repository list update"')
os.system('git push')