dchud / substar Goto Github PK
View Code? Open in Web Editor NEWsupports data mining class project: fetch repo info+stats from github api, parse into an analyzable format
License: MIT License
supports data mining class project: fetch repo info+stats from github api, parse into an analyzable format
License: MIT License
right now fetch.py is just getting data for old repos. but this works: https://api.github.com/repositories?since=18950000
so perhaps stripe ahead 1000 or 10000 at a time, rather than just the default 100+-ish, to get a representative sample of newer repos to mix in with the old.
it maxes out at 30 contributors if you don't paginate:
In [21]: r = requests.get('https://api.github.com/repos/mojombo/grit/contributors')
In [22]: r.links
Out[22]:
{'last': {'rel': 'last',
'url': 'https://api.github.com/repositories/1/contributors?page=2'},
'next': {'rel': 'next',
'url': 'https://api.github.com/repositories/1/contributors?page=2'}}
In [23]: r.links['next']['url']
Out[23]: 'https://api.github.com/repositories/1/contributors?page=2'
In [24]: r = requests.get(r.links['next']['url'])
In [25]: r.links
Out[25]:
{'first': {'rel': 'first',
'url': 'https://api.github.com/repositories/1/contributors?page=1'},
'prev': {'rel': 'prev',
'url': 'https://api.github.com/repositories/1/contributors?page=1'}}
maybe just stick with repos/:owner/:name/stats/contributors
? does that paginate?
In [26]: r = requests.get('https://api.github.com/repos/mojombo/grit/stats/contributors')
In [27]: r.status_code
Out[27]: 200
In [28]: r.links
Out[28]: {}
In [29]: d = r.json()
In [30]: len(d)
Out[30]: 42
nope! there's your answer.
rather than start over from repo 1 each time, examine collected data and start again from next bump after last saved data file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.