FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
github-tools/pull-my-github-star-list.js 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
/
pull-my-github-star-list.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (24 loc) · 960 Bytes
Breadcrumbs
github-tools
/
pull-my-github-star-list.js
Copy path
File metadata and controls
30 lines (24 loc) · 960 Bytes
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
var
fs
=
require
(
'fs'
)
;
var
child_exe
=
require
(
'child_process'
)
;
child_exe
.
exec
(
'curl -o starred.json -u username:password https://api.github.com/users/yangfch3/starred?per_page=500&page=1'
,
function
(
err
,
stdout
,
stderr
)
{
console
.
log
(
stdout
)
;
// 同步读取文件
var
src
=
fs
.
readFileSync
(
'./starred.json'
,
'utf-8'
)
;
var
jsonArray
=
JSON
.
parse
(
src
)
;
console
.
log
(
typeof
jsonArray
)
;
var
box
=
''
;
for
(
var
i
=
0
;
i
<
jsonArray
.
length
;
i
++
)
{
var
txtEle
=
'['
+
jsonArray
[
i
]
.
full_name
+
']'
+
'('
+
jsonArray
[
i
]
.
html_url
+
')'
+
'\n'
+
': '
+
jsonArray
[
i
]
.
description
+
'\n\n'
;
box
+=
txtEle
;
}
var
file
=
"./output.md"
;
fs
.
appendFile
(
file
,
box
,
function
(
err
)
{
if
(
err
)
console
.
log
(
"fail "
+
err
)
;
else
console
.
log
(
"写入文件ok"
)
;
}
)
;
child_exe
.
exec
(
'del starred.json'
,
function
(
err
,
stdout
,
stderr
)
{
console
.
log
(
stdout
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL