I want to get a list of files from given git repository. For an example, I want to get all *.js files from a given git repository. How can I use GitHub API to satisfy above requirement? or is there any way to get the list of *.js files from a git repository?
I want to get a list of files from given git repository. For an example, I want to get all *.js files from a given git repository. How can I use GitHub API to satisfy above requirement? or is there any way to get the list of *.js files from a git repository?
Share Improve this question asked Jan 10, 2018 at 16:27 MathuMathu 631 silver badge7 bronze badges1 Answer
Reset to default 7Here, what I did to find out all .js file in my own repository.
curl -i "https://api.github./search/code?q=extension:js+repo:vnation/NewsAggregator"
source: https://developer.github./v3/search/#search-code
EDIT
This is what I did to find out the path of ".classpath" file in the master branch of my repo.
curl -i "https://api.github./repos/vnation/NewsAggregator/contents/.classpath"
SOURCE: https://developer.github./v3/repos/contents/#get-contents
However, git response above API with base64 encoded content. So, to get raw data you should use below one.
curl -i "https://raw.githubusercontent./vnation/NewsAggregator/master/.classpath"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744789529a4593828.html
评论列表(0条)