javascript - Using GitHub API to retrieve files with specific extension - Stack Overflow

I want to get a list of files from given git repository. For an example, I want to get all *.js files f

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 badges
Add a ment  | 

1 Answer 1

Reset to default 7

Here, 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信