spencerkimball / stargazers

Analyze GitHub stars
Apache License 2.0
491 stars 42 forks source link

Only pulling 60 stargazers (2 pages) #11

Open RandallKent opened 6 years ago

RandallKent commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 3 years ago

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

luharias commented 2 years ago

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

Any luck? I am having the same issue.

rishabhpoddar commented 2 years ago

@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 commented 2 years ago

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 commented 4 months ago

I think I'm having this issue also :/