The Git API stores a lot of useful repository information for everyone, and the most important thing is that you can crawl it down and make it easy with Python, but there's an access limit when accessing the Git API.,没有认证的访问每小时只能进行60次。。。所以需要认证一下。
The simple way to do this is to add parameters to the Requsets, and the parameters are your client_id and Client_secret. Here's a Python demo:
Response=requsets.get ('https://api.github.com/repos/your_name/your_reponame/whatever' , params={'client_id': your_client_id,'client_secret' : Your_client_secret}) Print (response.headers['x-ratelimit-remaining') # See how many visits are left
That's it, client_id and Client_secret are all set in Settings.
There is another simple way is to use personal access token, where only set params={' Access_token ': Your_access_token} is OK. Access_token can also be set in Settings, but you can only look at it at a glance (you'll know when you set it), so you could save it.
OK, but there is a problem, even if you are authenticated login, your visit is only 5000/h, so to climb a large project may also need other methods (who have a good method also please enlighten), of course, to the page forcibly crawl, I think it is also possible ...
(PS: How did not find the function of publishing please ...) )
Personal access token accesses the Git API