You are not logged in.

#1 2022-08-09 15:40:53

linuxscoop
Member
Registered: 2022-08-09
Posts: 26

Get a list of trending packages

I want to make a script to get a list of trending packages from the info in https://pkgstats.archlinux.de/. Before I do it I wanted to make sure there isn't already a way to do this.

And if there isn't, would you recommend me to use python or bash for this? Thanks.

Offline

#2 2022-08-10 01:37:03

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Get a list of trending packages

You will need to sample the database and determine yourself if a package is “trending” (for your definition of it). Hypothetically you could use the API and query the packages resource, but the number of subjects alone is in the range of 100k — it would be overwhelming to the service. So it seems the best approach would be to contact administrators in the project thread and see if you can get a saner access to the data.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2022-08-10 02:58:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Get a list of trending packages

If by "trending" you mean packages with the highest popularity, then this should be trivial as the /packages query with no (or default) parameters returns the first 100 packages for the current month and - while I don't know if this is specifically documented - returns them sorted by popularity starting with the highest popularity values.  So in otherwords, the default /packages/ query gives you the 100 most popular packages.  In other words:

curl -s https://pkgstats.archlinux.de/api/packages \
	| jq -r '.packagePopularities[]|.name'

Last edited by Trilby (2022-08-10 03:04:17)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2022-08-10 09:43:24

linuxscoop
Member
Registered: 2022-08-09
Posts: 26

Re: Get a list of trending packages

By trending I mean how the current behavior compares to the usual behavior. I've only found a go package so I guess I'll have to write it in go.

Last edited by linuxscoop (2022-08-10 10:04:07)

Offline

Board footer

Powered by FluxBB