freedomofpress / dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
https://dangerzone.rocks/
GNU Affero General Public License v3.0
3.75k stars 172 forks source link

Process & publish aggregate download stats #927

Open eloquence opened 2 months ago

eloquence commented 2 months ago

We collect aggregate counts on package downloads, and GitHub collects them for asset downloads. No good reason not to publish this data as a static HTML report somewhere; monthly aggregates above a minimal threshold should be safe to publish, and that'll make it easier to work with & reason about both for us and outside contributors.

(Data like this can help inform prioritization decisions, e.g., regarding distribution strategies.)

almet commented 1 month ago

Just got the total number of downloads for year 2024 (so far), with this command and jq filters:

Total asset downloads for a specific year:

curl "https://api.github.com/repos/freedomofpress/dangerzone/releases?per_page=100" | jq '[.[] | select(.published_at | startswith("2024-")) | .assets[].download_count] | add'
15008

Also, split up by file extension:

curl "https://api.github.com/repos/freedomofpress/dangerzone/releases?per_page=100" | jq '
[
  .[] | 
  select(.published_at | startswith("2024-")) | 
  .assets[] | 
  {
    extension: (.name | split(".") | last),
    downloads: .download_count
  }
] | 
group_by(.extension) | 
map({
  extension: .[0].extension,
  total_downloads: map(.downloads) | add
})
'
[
  {
    "extension": "asc",
    "total_downloads": 118
  },
  {
    "extension": "dmg",
    "total_downloads": 6299
  },
  {
    "extension": "gz",
    "total_downloads": 1235
  },
  {
    "extension": "msi",
    "total_downloads": 7301
  },
  {
    "extension": "txt",
    "total_downloads": 54
  }
]
almet commented 6 days ago

I put something together available at https://dz-stats.notmyidea.org/ for now. I probably should publish the code somewhere so that it builds inside a CI job periodically. What's the best course of action for this @eloquence?

Should I open a new repo?