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

Get info from the new metric "Used By" #106

Open
matheusflauzino opened this issue Jul 4, 2019 · 3 comments
Open

Get info from the new metric "Used By" #106

matheusflauzino opened this issue Jul 4, 2019 · 3 comments

Comments

@matheusflauzino
Copy link

GitHub introduced a new metric, which I find much more relevant than stars or downloads. It shows the number of times a dependency is used by other repositories. It would be nice to have that metric added to Github-scraper.

rep1

rep2

@nelsonic
Copy link
Owner

nelsonic commented Jul 5, 2019

@matheusflauzino agree 100% that the Used by metric is useful. 👍
If you or anyone else has time to add the test(s) and selector in a Pull Request,
I'd be happy to merge it.

@nelsonic
Copy link
Owner

nelsonic commented Jul 5, 2019

I just took a quick look into this and even though it appears to be there in the DOM:
https://github.com/dwyl/decache
Screenshot 2019-07-04 at 09 17 57

image

But sadly, it does not appear when the page is requested via node.js ...
Our node.js http.request only receives the html and none of the client-side rendered javascript...

Try it for yourself, disable JS in your browser and refresh the page:
image

No more "Used by" ...
image

We could get around this by using a Chromium instance (e.g: PhantomJS) and waiting for the JS to finish rendering. However, I checked and it won't work because we would need a logged in session in PhantomJS (the counter is not shown if you visit the page in incognito mode...).

@nelsonic
Copy link
Owner

nelsonic commented Jul 5, 2019

Suggestions very much welcome for how to overcome this ... 👍

nelsonic added a commit that referenced this issue Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants