-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (30 loc) · 1.13 KB
/
main.py
File metadata and controls
37 lines (30 loc) · 1.13 KB
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
31
32
33
34
35
36
37
import base64, json
from urllib.request import build_opener, HTTPSHandler, HTTPError, Request
from urllib.parse import quote as urlquote
from bs4 import BeautifulSoup
from users import Users, user
from AuthoRequest import AuthoRequest
def readUsers(URL):
the_page = AuthoRequest(URL)
soup = BeautifulSoup(the_page, "html5lib")
usersJson = json.loads(soup.get_text())
USERS = []
for i in usersJson:
USERS.append(i['login'])
lastid = usersJson[len(usersJson)-1]['id']
return USERS, lastid
Users = Users(0)
# while Users.lastid <= 45:
# startURL = 'https://api.github.com/users?since=' + str(Users.lastid)
# UsersList,lastid = readUsers(startURL)
# Users.lastid = lastid
# for item in UsersList:
# Users[item] = user(item)
Users['TimIainMarsh'] = user('TimIainMarsh')
Users['jasrusable'] = user('jasrusable')
Users['CraigNielsen'] = user('CraigNielsen')
Users['avoid3d'] = user('avoid3d')
for uname, user_thing in Users.items():
print(str(user_thing.name) + " " + str(user_thing.public_repos))
for repoN, repo in user_thing.Repos.items():
print('--'+str(repo.repoName)+' '+repo.language)