Reputation: 161
So I want to gather some information about an Institute where students upload projects and stuff in Github.
So I want to gather all that an analyse it. But in order to do that I have to request it from git hub. I want to do that using R. Or secondary using Python.
But i dont quite understand how could I use that in R as a get Request.
So if anyone could show me an example I would appreciate that.
Thanx!
Upvotes: 0
Views: 656
Reputation: 168
Requests is a HTTP library for python that is very robust and easy to use. JSON and XML responses can be parsed easily.
Use it as below
import requests
r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
Use Github credentials'user'
and 'pass'
for authentication.
To get a list of reporsitories by a user or oranisation you can use Github's REST APIs. Github has a REST API documentation. An HTTP GET request as below can fetch repositories for the specified org.
GET /orgs/:org/repos
find it here https://developer.github.com/v3/repos/#list-organization-repositories
Upvotes: 1