stackoverflow-card
stackoverflow-card copied to clipboard
Add support for `site` parameter to fetch stats from different StackExchange sites
This PR introduces support for a new query parameter site, allowing the service to fetch user statistics from any StackExchange site instead of being limited to StackOverflow.
- New
sitequery parameter (defaults tostackoverflowif not provided). - Handles
.comsuffix by stripping it automatically. - Updated API request to
api.stackexchange.comto use the chosen site. - Updated rank URL generation to point to the correct site domain.
Why: Previously, the service only supported StackOverflow. With this change, it becomes more flexible and can be used for other StackExchange communities.
Testing:
- Call with
?userID=<id>→ defaults to StackOverflow. - Call with
?userID=<id>&site=superuser→ fetches from SuperUser. - Call with
?userID=<id>&site=askubuntu.com→.comsuffix is stripped and handled correctly.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| stackoverflow-card | Preview | Comment | Sep 10, 2025 6:16pm |
don't pay attention to the commits after closing (and before reopening the PR), there I just made the repository for myself