FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github-tools/github-clone-stars-master.py at master · udpsec/github-tools · GitHub
udpsec
/
github-tools
Public
Notifications
You must be signed in to change notification settings
Fork
6
Star
25
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
github-tools
/
github-clone-stars-master.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (25 loc) · 1.34 KB
Breadcrumbs
github-tools
/
github-clone-stars-master.py
Copy path
File metadata and controls
34 lines (25 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env python3
__author__
=
'pete404'
if
__name__
==
'__main__'
:
import
json
,
argparse
import
requests
parser
=
argparse
.
ArgumentParser
(
description
=
"Clones all of a github user's starred repositories."
)
parser
.
add_argument
(
"user"
,
help
=
"The github user of the starred repositories."
)
parser
.
add_argument
(
"-v"
,
"--verbose"
,
help
=
"Enables verbose output."
,
action
=
"store_true"
)
parser
.
add_argument
(
"--bare"
,
help
=
"Enables cloning to a bare git repository."
,
action
=
"store_true"
)
args
=
parser
.
parse_args
()
if
args
.
verbose
:
print
(
"Username: "
,
args
.
user
,
"
\n
Bare repository? "
,
args
.
bare
)
print
(
"Connecting..."
)
header
=
{
"user-agent"
:
"pete404/github-clone-stars"
}
#Following api documentation at: https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
star_request
=
requests
.
get
(
"http://api.github.com/users/"
+
args
.
user
+
"/starred"
,
headers
=
header
)
#alternatively access the user url, parse the starred url, and access it (more requests though)
#star_request = requests.get("http://api.github.com/users/" + args.user, headers=header)
#user = json.loads(star_request.json())
#
#
if
args
.
verbose
:
print
(
"Parsing request"
)
stars
=
json
.
loads
(
star_request
.
json
())
print
(
stars
[
1
][
"clone_url"
])
Back
|
FazBrowse Home
|
New Git URL