pop-os / cosmic-store

WIP COSMIC app store
GNU General Public License v3.0
68 stars 38 forks source link

flathub-stats: what can Flathub do to make things easier for you? #27

Open barthalion opened 4 months ago

barthalion commented 4 months ago

Hi Jeremy, this is Bart from Flathub. I have recently stumbled upon https://github.com/pop-os/cosmic-store/tree/master/flathub-stats and can’t help but notice you had to apply some transformations to the raw data to make it more useful for Cosmic Store. While we have some high-level API for this as well, I’ve been wondering what can we provide on our end to make this more maintainable for you? We could potentially add a custom endpoint providing download stats, if we can discuss the required schema first.

jackpot51 commented 4 months ago

Hello @barthalion, thanks for reaching out. I was interested in sorting categories by downloads, so I am taking all the daily data for the past month and combining it into monthly totals per ID. Then in the store I sort using those totals. I'm trying to roughly replicate the sort order on flathub's website for the category pages. An API to get a sorted array of app IDs for each page (recently updated, most popular, the category pages) on the flathub website would work, it could be paged as well to limit the data per request.

For now, the stats json files are working well and have the advantage of being available offline as I am bundling the results with cosmic-store.