@@ -3,13 +3,13 @@ let username = `xgqfrms-GitHub`;
3
3
4
4
fetch ( `https://api.github.com/users/${ username } /${ repo } ` , {
5
5
data : {
6
- client_id : '08ecc2f68d922f18800e' ,
7
- client_secret : '5846d428b5340812b76c9637eceaee979340b922'
6
+ client_id : process . env . NODE_ENV_ID ,
7
+ client_secret : process . env . NODE_ENV_SECRET ,
8
8
}
9
9
} )
10
10
. then ( ( response ) => response . json ( ) )
11
11
. then ( ( json ) => {
12
- console . log ( `json = ${ json } ` ) ;
12
+ console . log ( `json =` , json ) ;
13
13
return repos = json ;
14
14
} )
15
15
. then ( ( repos ) => {
@@ -22,10 +22,51 @@ fetch(`https://api.github.com/users/${username}/${repo}`,{
22
22
}
23
23
} ) ;
24
24
25
+
26
+
25
27
// https://api.github.com/users/xgqfrms
26
28
27
29
// https://api.github.com/users/xgqfrms/react2 ???
28
30
31
+ /*
32
+
33
+ /**
34
+ * [nct: fetch data]
35
+ * @author : xgqfrms
36
+ * @date : 2017-06-12
37
+ */
38
+
39
+ const fetch = require ( 'node-fetch' ) ;
40
+ const showdata = require ( './showdata' ) ;
41
+
42
+ // NODE_ENV_ID = ``;
43
+ // NODE_ENV_SECRET = ``;
44
+
45
+ const nct = ( username , repo ) => {
46
+ let url = `https://api.github.com/repos/${ username } /${ repo } /commits` ;
47
+ let options = {
48
+ data : {
49
+ client_id : process . env . NODE_ENV_ID ,
50
+ client_secret : process . env . NODE_ENV_SECRET ,
51
+ } ,
52
+ } ;
53
+ fetch ( url , options )
54
+ . then ( ( res ) => res . json ( ) )
55
+ . then ( ( repos ) => {
56
+ showdata ( repos ) ;
57
+ } )
58
+ . catch ( err ) = > {
59
+ console . log ( `error info =` , err ) ;
60
+ } ;
61
+ } ;
62
+
63
+ module . exports = nct ;
64
+
65
+
66
+ https ://github.com/xgqfrms-GitHub/Node-CLI-Tools/blob/master/libs/index.js
67
+
68
+
69
+ * /
29
70
30
71
31
72
0 commit comments