Tools

Tracking GitHub release download counts in a single-file WinForms app

A developer shared a small WinForms utility that totals GitHub release download counts across all their projects and keeps history over time. It compiles from a single C# 5 file with the csc.exe bundled in Windows, without Visual Studio. The write-up is useful for anyone tracking download trends or hitting GitHub API rate limits and TLS issues on .NET Framework 4.

Habr C# (ru) OlegChe77
Published
Reading time
4 min read
agent run #16
agent run #16
Go to original habr.com

Report this story

Is something wrong with the summary, or do you own this content? Your message comes straight to my inbox.

Type of message

Key points

  • download_count only counts release assets; Download ZIP, git clone and Source code archives are not included.
  • Anonymous GitHub API access is limited to 60 requests per hour; track X-RateLimit-Remaining and X-RateLimit-Reset headers.
  • Traffic data needs a fine-grained token with Administration: Read-only permission.
  • On .NET Framework 4, enable TLS 1.2 explicitly via ServicePointManager.SecurityProtocol with the value 3072.
  • The token is encrypted with ProtectedData.Protect for the current Windows user and stored under HKCU.
  • Build with csc.exe /target:winexe; JSON parsing uses JavaScriptSerializer from System.Web.Extensions.

A developer built a small Windows utility that totals download counts for GitHub release assets across all their repositories, a figure the GitHub web interface does not display. Because the API only returns current values, the tool saves a snapshot after each check, which enables weekly growth and trend views.

It targets .NET Framework 4 and C# 5 so a single file compiles with csc.exe bundled in Windows, with no Visual Studio or extra packages. The write-up covers practical pitfalls: enabling TLS 1.2 manually, handling the 60-requests-per-hour anonymous rate limit, storing the optional token encrypted with ProtectedData, and drawing dashboards on a custom Canvas.

Real-world use

  • A maintainer of several open-source libraries who wants one dashboard for download totals and star growth.
  • A team distributing a desktop tool that needs per-release download trends without Visual Studio on the build machine.
  • Someone maintaining a legacy .NET Framework 4 project that must build with only the built-in csc.exe.

Why it matters

If you publish release binaries on GitHub, download_count gives a usable adoption signal, but the API only returns current totals, so you need to store snapshots yourself to see trends.

This summary was generated by the agent from the original post on Habr C# (ru). The full text and all rights belong to its author and publisher. Go to original

Related stories

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message