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

Only pulling 60 stargazers (2 pages) #11

Open
RandallKent opened this issue May 13, 2018 · 7 comments
Open

Only pulling 60 stargazers (2 pages) #11

RandallKent opened this issue May 13, 2018 · 7 comments

Comments

@RandallKent
Copy link

Stargazers was only getting through 60 (2 pages) of our stargazers ☹️

It appears the format of the Link response header may have changed to now include a rel="prev" on pages 2+ which broke the RegEx pattern seen @ fetch/fecth.go#L62. Adding a .* to the RegEx pattern has resolved the issue for me. Will be submitting a PR shortly!


Value of Link header see with 1st Page:

<https://api.github.com/repositories/<repo>/stargazers?page=2>; rel="next", <https://api.github.com/repositories/<repo>/stargazers?page=999>; rel="last"

Value of Link header see with 2+ Pages:

Link: <https://api.github.com/repositories/<repo>/stargazers?page=1>; rel="prev", <https://api.github.com/repositories/<repo>/stargazers?page=3>; rel="next", <https://api.github.com/repositories/<repo>/stargazers?page=999>; rel="last", <https://api.github.com/repositories/<repo>/stargazers?page=1>; rel="first"
@tianshanghong
Copy link

Hi @RandallKent , I modified the code according to your new PR. However, the program still only gets 60 stargazers' info. Could you give some advice? Thanks a lot.

@RandallKent
Copy link
Author

@tianshanghong - Did you build/install after modifying fetch/fecth.go#L62?

Alternatively, assuming you modified $HOME/go/src/github.com/spencerkimball/stargazers/fetch/fetch.go, you can just run that code by executing:

cd $HOME/go/src/github.com/spencerkimball/stargazers \
&&  go run main.go :owner/:repo --token=:access_token [flags]

@rishabhpoddar
Copy link

Even after the modification, it still fetches only 60 stargazers.

@luharias
Copy link

luharias commented Aug 8, 2021

Even after the modification, it still fetches only 60 stargazers.

Any luck? I am having the same issue.

@rishabhpoddar
Copy link

@luharias yes.. the issue is that the imports in the library are from the github repo and you are making changes to your local files. So those changes are not being used when running the program. Instead, you should change all the imports in all the files to point to your local files with the modifications (using relative paths).. this fixed the issue for me.

@luharias
Copy link

Instead, you should change all the imports in all the files to point to your local files with the modifications (using relative paths).. this fixed the issue for me.

Thank you so much @rishabhpoddar, that helped me resolve it.

@janaka
Copy link

janaka commented Mar 6, 2024

I think I'm having this issue also :/

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

No branches or pull requests

5 participants