Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt_stats_request limited to 100 results #23

Closed
jiahao opened this issue Feb 20, 2015 · 7 comments · Fixed by #24
Closed

attempt_stats_request limited to 100 results #23

jiahao opened this issue Feb 20, 2015 · 7 comments · Fixed by #24

Comments

@jiahao
Copy link
Contributor

jiahao commented Feb 20, 2015

The stats URI appears to be hard limited to 100 results and therefore it is not possible to retrieve more than 100 contributors, stargazers, etc. Specifying the additional query "?pages=2" does not change the results, as would be expected from the pagination section of the API

@WestleyArgentum
Copy link
Collaborator

That's weird, I'm able to get full lists for both contributors and stargazers:

julia> stargazers("julialang", "julia", auth = a)
5107-element Array{User,1}:
 User - brixen
 User - daksis
 User - willcodeforfoo
 User - lancecarlson
 User - DocSavage
 User - brapse
 User - vic
 User - sbusso
 User - raggi
 User - methodmissing
 User - brainopia
 User - jarkko
 User - auser
 User - jarib
 ⋮
 User - paegun
 User - usptact
 User - markdjthomas
 User - zhengxwen
 User - tpapp
 User - hellerve
 User - 315234
 User - SimonDanisch
 User - wxia
 User - hibiu1
 User - shyam057cs
 User - twolodzko
 User - jsbee

Maybe the problem is with unauthenticated requests? Unfortunately I can't test here, unauthenticated requests from my ip address are being blocked by github for some reason...

@WestleyArgentum
Copy link
Collaborator

Oh, it has been so long since I've looked at this, totally forgot about https://github.com/WestleyArgentum/GitHub.jl/blob/master/src/utils.jl#L53

So stargazers, contributors, etc, should be making the repeated requests for you (and I'm not being blocked by github, I'm making too many calls haha).

@WestleyArgentum
Copy link
Collaborator

Sorry for totally narrating the debugging process, realized that you had attempt_stats_request in the title and that my list of contributors was in fact truncated. Looks like we need to work get_pages into stats requests

@WestleyArgentum
Copy link
Collaborator

Alas! I refactored this to support paging, only to discover that github doesn't do paging for contributors because it's too expensive an operation: https://stackoverflow.com/questions/18148490/how-can-i-get-more-than-100-results-from-github-api-v3-using-github-api-gem

So I guess this is as fixed as I can make it -- if github ever flips the switch and turns on paging for contributors then it should work

@jiahao
Copy link
Contributor Author

jiahao commented Feb 21, 2015

Actually you can get paginated contributors using a different URL:

https://api.github.com/repos/JuliaLang/julia/contributors?page=2

It doesn't contain the weeks information but I don't think many people use that anyway. (I certainly don't need it for World of Julia.)

@WestleyArgentum
Copy link
Collaborator

Interesting, I'll try looking into that then

@WestleyArgentum
Copy link
Collaborator

Please have a look at that pull request and let me know if it works for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants