Repository navigation
06 Telemetry and Scraping Engine
Reverse-Engineering GitHub Profile Modals, Parsing Milestones, and Resilient HTTP Ingestion
As established in earlier chapters, GitHub provides zero native REST or GraphQL endpoints for achievements. While an unauthenticated GET to https://api.github.com/users/{username} yields basic biographical information, it contains no achievement nodes.
However, GitHub's public web interface renders achievements on user profiles and allows users to click into each badge to view an achievement history modal:
https://github.com/users/{username}/achievements/{badge_slug}
GitVerse's internal/github package bridges this gap by executing an automated, highly optimized HTML scraping and telemetry extraction pipeline.
graph TD
Start[User Submits Handle] --> FetchProfile[GET /username?tab=achievements]
FetchProfile --> ParseList[Parse Unlocked Badges & Tier Badges]
ParseList --> Filter[Filter Valid Badge Slugs]
Filter --> DetailFanOut[Async Fetch /users/username/achievements/slug]
DetailFanOut --> ParseModal[Extract Unlock Timestamps & Milestone Counts]
ParseModal --> Reconcile[Reconcile with Catalog Rules]
Reconcile --> EngineResult[Final Aggregated Report]
GitVerse uses Go's standard golang.org/x/net/html token parser. This avoids bloated headless browser dependencies (like Puppeteer or Playwright), ensuring sub-second response times:
When scraping https://github.com/{username}?tab=achievements:
- GitVerse searches for the
<div class="achievement-badge-container">nodes. - Extracts
altortitleattributes corresponding to canonical badge identifiers. - Captures badge tier multipliers (e.g.,
x2,x3,x4badge rings).
For each detected achievement, GitVerse requests the individual badge history fragment:
GET /users/{username}/achievements/{badge_slug} HTTP/1.1
Host: github.com
User-Agent: GitVerse-Engine/1.0 (+https://mygitverse.vercel.app)
Accept: text/htmlInside this fragment, GitHub renders:
- The exact UTC timestamp when each tier was awarded (
<relative-time datetime="...">). - The repository in which the milestone was reached (e.g.,
TheVicky1/GitVerse). - The milestone pull request or discussion number (e.g.,
#42).
Public scraping against GitHub requires strict operational safeguards:
GitVerse does not make synchronous sequential calls; nor does it execute uncontrolled parallel floods. It utilizes a Go worker pool with a maximum concurrency limit (
Requests originate from a persistent http.Transport with HTTP/2 enabled, TCP keep-alive, and an authentic browser User-Agent string alongside standard Accept-Language headers.
If GitHub returns an HTTP 429 Too Many Requests or 403 Forbidden, the engine pauses using exponential backoff with full jitter:
On the Vercel web deployment, when public scraping encounters IP exhaustion, GitVerse transparently falls back to an authenticated GitHub Bot Token (GH_BOT_TOKEN) to retrieve repository and user metadata via the REST API to cross-calibrate missing metrics.
| ๐๏ธ Project Hub | ๐ ๏ธ Developer Docs | ๐ฌ Community & Support |
|---|---|---|
| GitHub Repository | System Architecture | Live Web App |
| Track Any Profile | Achievement Catalog | Open Issues |
| Explore Badge Guides | CLI Reference | Pull Requests |
| Project Roadmap | Testing & QA Matrix | Maintainer Runbook |