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

Feature: downloads leaderboard #73

Open
epoberezkin opened this issue Feb 3, 2019 · 8 comments
Open

Feature: downloads leaderboard #73

epoberezkin opened this issue Feb 3, 2019 · 8 comments

Comments

@epoberezkin
Copy link
Contributor

epoberezkin commented Feb 3, 2019

@pvorb The idea is to show the leaderboard on the homepage without entering any packages. Could be top 10 packages in the last week, month, year. It could be updated daily if you have concerns that it is a heavy query to hit on each home page load.
It should be relatively straightforward, unless I am missing something.

Given that downloads leaderboard doesn't exist anywhere else it could give you some traffic boost.

@epoberezkin
Copy link
Contributor Author

Also could be the same for authors (I forgot that you can compare authors stats :)

@epoberezkin
Copy link
Contributor Author

Found this: #35
I think there is a database now?

@pvorb
Copy link
Owner

pvorb commented Feb 3, 2019

There is a database right now, but it only serves as a cache. The problem is that I don't download the numbers for all the packages every day, but only those that are requested. The numbers are then persisted and won't be downloaded again.

For the feature you requested, the first thing to do would be to get the list of all packages every day, and then download the counts for every package.

While it sounds cool, I don't think I'll implement this feature. There doesn't seem to be a good API on npm's end to get the names of every package. If there was some sort of daily dump it could be easily done.

@epoberezkin
Copy link
Contributor Author

epoberezkin commented Feb 3, 2019

I see. But it should be relatively simple to see and maintain top 10 of all requested by updating daily top 100 of all requested. A bit less simple though :)

@pvorb
Copy link
Owner

pvorb commented Feb 3, 2019

But if it only included the top X of requested packages, how helpful would that statistic be?

@epoberezkin
Copy link
Contributor Author

The idea is that sooner or later most important packages will be requested. I meant "show top 10 of top 100 ever requested packages"

@epoberezkin
Copy link
Contributor Author

epoberezkin commented Feb 3, 2019

So trying to have the full list of all packages, you'll let the visitors to create the lists of important packages and updating them daily. Or maybe a good start could be to download stats of these packages: https://gist.github.com/anvaka/8e8fa57c7ee1350e3491 and then maintain them daily (I think you can get weekly, monthly and annual in one API call each, you don't need as much calls as to do the chart.

@pvorb
Copy link
Owner

pvorb commented Feb 3, 2019

There's a complete list of all packages at https://replicate.npmjs.com/_all_docs. Maybe I can use that for downloading all package stats in a daily cron job...

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