-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub2owl.py
More file actions
47 lines (37 loc) · 1.58 KB
/
Copy pathgithub2owl.py
File metadata and controls
47 lines (37 loc) · 1.58 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
38
39
40
41
42
43
44
45
46
47
from datetime import datetime
import sys
from github import Github
from scraper import build_graph, SeedType
if __name__ == "__main__":
if len(sys.argv) != 6:
print("Invalid number of parameters!")
# username: github2foaf
# password: fanizzi2016
# seed name: mnielsen
graph_filename = sys.argv[1]
github_username = sys.argv[2]
github_password = sys.argv[3]
seed_name = sys.argv[4]
seed_type = SeedType[sys.argv[5]]
github = Github(github_username, github_password)
print("Number of remaining requests:", github.rate_limiting[0])
print("Limit of requests:", github.rate_limiting[1])
rate_limiting_resettime = github.rate_limiting_resettime
print("Time to requests limit reset:",
datetime.fromtimestamp(rate_limiting_resettime)
.strftime('%Y-%m-%d %H:%M:%S'))
graph = build_graph(github, github_username, github_password,
seed_name, seed_type,
max_following=50,
max_contributors=50,
max_members=50,
max_repos=50,
max_orgs=50,
max_iterations=2500)
print("Number of remaining requests:", github.rate_limiting[0])
print("Limit of requests:", github.rate_limiting[1])
rate_limiting_resettime = github.rate_limiting_resettime
print("Time to requests limit reset:",
datetime.fromtimestamp(rate_limiting_resettime)
.strftime('%Y-%m-%d %H:%M:%S'))
graph.serialize(destination=graph_filename, base="", format="pretty-xml")