@@ -82,7 +82,7 @@ https://api.github.com/repos/octocat/Hello-World
82
82
"name" : " Hello-World" ,
83
83
"full_name" : " octocat/Hello-World" ,
84
84
"owner" : {
85
- "login" : " octocat" ,
85
+ "login" : " octocat"
86
86
},
87
87
"html_url" : " https://github.com/octocat/Hello-World" ,
88
88
"description" : " My first repository on GitHub!" ,
@@ -98,33 +98,37 @@ https://api.github.com/repos/octocat/Hello-World
98
98
99
99
## 2.2 Crawl the file tree of the Repository
100
100
101
- Retrieve the file tree of the given repository by providing the repo owner, the name of the repo, and the default_branch from crawling the Github Repo Information
101
+ Retrieve the file tree of the given repository by providing the repo owner, the name of the repo, and the commit hash.
102
102
103
103
### 2.2.1 Information to fetch:
104
104
105
- - sha
106
- - tree.path
105
+ - path
106
+ - files
107
+ - subdirectories
107
108
108
109
### 2.2.2 Example
109
110
110
- https://api.github.com/repos/octocat /Hello-World/git/trees/master?recursive=1
111
+ https://api.github.com/repos/Octocat /Hello-World/contents?ref=7fd1a60b01f91b314f59955a4e4d4e80d8edf11d
111
112
112
113
``` json
113
- {
114
- "sha" : " 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d" ,
115
- "url" : " https://api.github.com/repos/octocat/Hello-World/git/trees/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d" ,
116
- "tree" : [
117
- {
118
- "path" : " README" ,
119
- "mode" : " 100644" ,
120
- "type" : " blob" ,
121
- "sha" : " 980a0d5f19a64b4b30a87d4206aade58726b60e3" ,
122
- "size" : 13 ,
123
- "url" : " https://api.github.com/repos/octocat/Hello-World/git/blobs/980a0d5f19a64b4b30a87d4206aade58726b60e3"
114
+ [
115
+ {
116
+ "name" : " README" ,
117
+ "path" : " README" ,
118
+ "sha" : " 980a0d5f19a64b4b30a87d4206aade58726b60e3" ,
119
+ "size" : 13 ,
120
+ "url" : " https://api.github.com/repos/octocat/Hello-World/contents/README?ref=7fd1a60b01f91b314f59955a4e4d4e80d8edf11d" ,
121
+ "html_url" : " https://github.com/octocat/Hello-World/blob/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README" ,
122
+ "git_url" : " https://api.github.com/repos/octocat/Hello-World/git/blobs/980a0d5f19a64b4b30a87d4206aade58726b60e3" ,
123
+ "download_url" : " https://raw.githubusercontent.com/octocat/Hello-World/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README" ,
124
+ "type" : " file" ,
125
+ "_links" : {
126
+ "self" : " https://api.github.com/repos/octocat/Hello-World/contents/README?ref=7fd1a60b01f91b314f59955a4e4d4e80d8edf11d" ,
127
+ "git" : " https://api.github.com/repos/octocat/Hello-World/git/blobs/980a0d5f19a64b4b30a87d4206aade58726b60e3" ,
128
+ "html" : " https://github.com/octocat/Hello-World/blob/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README"
124
129
}
125
- ],
126
- "truncated" : false
127
- }
130
+ }
131
+ ]
128
132
```
129
133
130
134
## 2.3 Crawl the files (Code) of the Repository
0 commit comments