Python use experience to get the list of GitHub code bases

1. Background

According to the project requirements, it is required to obtain the repo API of GitHub so that the repo data can be extracted and analyzed. After a day of research, we finally solved this problem, although the efficiency is still relatively low.

Because the API of GitHub that displays repo lists the details of each repo, and it is in JSON format. It seems that there is no way to analyze multiple JSON format data, so the stupid split and re method is used. If you have a better way, don't leave a message for discussion!

2. Code

The value of num refers to the ID of the page. We can make a cycle and continuously increase the value of num to extract repo infinitely. Because GitHub's API has restrictions on traffic, this is a feasible approach.

The effect is as follows (the API address of the extracted repo):

https://api.github.com/repos/wycats/merb-core

https://api.github.com/repos/rubinius/rubinius

https://api.github.com/repos/mojombo/god

https://api.github.com/repos/vanpelt/jsawesome

https://api.github.com/repos/wycats/jspec

https://api.github.com/repos/defunkt/exception_ logger

https://api.github.com/repos/defunkt/ambition

https://api.github.com/repos/technoweenie/restful-authentication

https://api.github.com/repos/technoweenie/attachment_ fu

https://api.github.com/repos/topfunky/bong

https://api.github.com/repos/Caged/microsis

https://api.github.com/repos/anotherjesse/s3

https://api.github.com/repos/anotherjesse/taboo

https://api.github.com/repos/anotherjesse/foxtracs

https://api.github.com/repos/anotherjesse/fotomatic

https://api.github.com/repos/mojombo/glowstick

https://api.github.com/repos/defunkt/starling

https://api.github.com/repos/wycats/merb-more

https://api.github.com/repos/macournoyer/thin

https://api.github.com/repos/jamesgolick/resource_ controller

https://api.github.com/repos/jamesgolick/markaby

https://api.github.com/repos/jamesgolick/enum_ field

https://api.github.com/repos/defunkt/subtlety

https://api.github.com/repos/defunkt/zippy

https://api.github.com/repos/defunkt/cache_ fu

https://api.github.com/repos/KirinDave/phosphor

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>