{"id":22795951,"url":"https://github.com/openlab-x/githubviewscounter","last_synced_at":"2026-03-17T21:37:36.317Z","repository":{"id":263836624,"uuid":"891439077","full_name":"openlab-x/GithubViewsCounter","owner":"openlab-x","description":"GitHubViewsCounter is an open-source, lightweight tool to track and display the total views of GitHub repositories or profiles in real-time. Designed to work seamlessly in GitHub README files, it dynamically updates every time someone visits your repository or profile.","archived":false,"fork":false,"pushed_at":"2024-11-22T20:23:12.000Z","size":397,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T17:50:47.503Z","etag":null,"topics":["github","github-api","githubviewscounter","php","php-library","php7","php8","proxy","readme","readme-md","readme-profile","views","views-count","viewscounter"],"latest_commit_sha":null,"homepage":"https://github.com/openlab-x/GithubViewsCounter","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openlab-x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T10:37:52.000Z","updated_at":"2025-02-01T19:03:11.000Z","dependencies_parsed_at":"2025-02-05T20:28:27.696Z","dependency_job_id":"53c3bbf4-5cc2-4ef2-9864-da7baf94f81a","html_url":"https://github.com/openlab-x/GithubViewsCounter","commit_stats":null,"previous_names":["openlab-x/githubviewscounter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openlab-x/GithubViewsCounter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlab-x%2FGithubViewsCounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlab-x%2FGithubViewsCounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlab-x%2FGithubViewsCounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlab-x%2FGithubViewsCounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openlab-x","download_url":"https://codeload.github.com/openlab-x/GithubViewsCounter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openlab-x%2FGithubViewsCounter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30632088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-api","githubviewscounter","php","php-library","php7","php8","proxy","readme","readme-md","readme-profile","views","views-count","viewscounter"],"created_at":"2024-12-12T05:09:26.631Z","updated_at":"2026-03-17T21:37:36.293Z","avatar_url":"https://github.com/openlab-x.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHubViewsCounter ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=GithubViewsCounter\u0026theme=dark)\n\n![GitHubViewsCounter](logo/logo_v1_0_0.png)\n\n---\n\n## About\n\n**GitHubViewsCounter** is an open-source, lightweight tool to track and display the total views of GitHub repositories or profiles in real-time. It is designed to work seamlessly in GitHub README files and dynamically updates every time someone visits your repository or profile.\n\n\n## Table of Contents\n\n- [Features](#features)\n- [Live Demo and Examples](#live-demo-and-examples)\n- [Getting Started](#getting-started)\n- [Usage](#usage)\n  - [Repository View Counter](#repository-view-counter)\n  - [Profile View Counter](#profile-view-counter)\n- [Customization](#customization)\n- [Technology Stack](#technology-stack)\n- [Challenges and Design Decisions](#challenges-and-design-decisions)\n- [Acknowledgments](#acknowledgments)\n- [Bug Reporting](#bug-reporting)\n- [License](#license)\n- [Code of Conduct](#code-of-conduct)\n- [Contact](#contact)\n\n\n\n## Features\n\n1. **Dynamic Total Views Counter**:\n   - Automatically updates when someone accesses your GitHub README.md.\n\n2. **Valid Repository Verification**:\n   - Ensures valid repositories and usernames by sending an **HTTP HEAD request** to verify repository existence.\n\n3. **Customizable Themes**:\n   - Offers `light`, `dark`, and fully customizable themes (background, text, and border colors).\n\n4. **Responsive Design**:\n   - Works on any screen size and aligns perfectly in GitHub README files.\n\n5. **Sorted Repositories**:\n   - Displays repositories sorted by views (highest to lowest).\n\n6. **Protected Data**:\n   - Uses IP-based proxy-safe tracking, compatible with GitHub's `camo` system.\n\n7. **Live Counter for Users**:\n   - Tracks the total number of users utilizing GitHubViewsCounter, displayed on counters.\n\n\n\n## Live Demo and Examples\n\n### Live Demos\n\n- **Repository View Counter (Light Theme)**:\n  ```markdown\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=OpenQRCode\u0026theme=light)\n  ```\n  **Preview**:\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=OpenQRCode\u0026theme=light) [\u003cimg alt=\"Made With GitHubViewsCounter\" src=\"https://openlabx.com/githubviewscounter/api/footer_image.php?theme=light\" /\u003e](https://github.com/openlab-x/GitHubViewsCounter)\n\n\u003cbr\u003e\n\n- **Repository View Counter if the repository doesn't exist**:\n  ```markdown\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=OpenQRCode\u0026theme=light)\n  ```\n  **Preview**:\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=ImagineDragon\u0026theme=light) [\u003cimg alt=\"Made With GitHubViewsCounter\" src=\"https://openlabx.com/githubviewscounter/api/footer_image.php?theme=light\" /\u003e](https://github.com/openlab-x/GitHubViewsCounter)\n\n\u003cbr\u003e\n\n- **Profile View Counter (Dark Theme)**:\n  ```markdown\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=openlab-x\u0026theme=dark)\n  ```\n  **Preview**:\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=openlab-x\u0026theme=dark)\n\n\u003cbr\u003e\n\n- **Profile View Counter if the username doesn't exist**:\n  ```markdown\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=CuttyGirl69\u0026theme=dark)\n  ```\n  **Preview**:\n  ![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=CuttyGirl69\u0026theme=dark)\n\n\n---\n\n## Getting Started\n\n### 1. **Clone the Repository**\n```bash\ngit clone https://github.com/openlab-x/GitHubViewsCounter.git\ncd GitHubViewsCounter\n```\n\n### 2. **Set Up a Local Server**\n- Use PHP’s built-in server:\n  ```bash\n  php -S localhost:8000 -t api/\n  ```\n- Alternatively, deploy on **Apache/Nginx** or use **XAMPP**.\n\n### 3. **Adjust Permissions**\nEnsure the `data/` directory is writable:\n```bash\nchmod -R 755 data/\n```\n\n---\n\n## Usage\n\n### Repository View Counter\n\nTo add a view counter for a specific repository, use the following Markdown:\n```markdown\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=yourusername\u0026repository=yourrepo\u0026theme=light)\n```\n\n#### Example:\n```markdown\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=OpenQRCode\u0026theme=dark)\n```\n\n- [Made With GitHubViewsCounter](https://github.com/openlab-x/GitHubViewsCounter)\n\n---\n\n### Profile View Counter\n\nTo display total views across all repositories:\n```markdown\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=yourusername\u0026theme=dark)\n```\n\n#### Example:\n```markdown\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcmp.php?username=openlab-x\u0026theme=light)\n```\n\n- [Made With GitHubViewsCounter](https://github.com/openlab-x/GitHubViewsCounter)\n\n---\n\n## Customization\n\n### Themes\n- `theme=light`: Default light theme.\n- `theme=dark`: A darker theme.\n\n\n### Custom Colors\nYou can define custom colors using hex values for the following parameters:\n| Parameter | Description |\n| --- | --- |\n| `bgColor` | Background color (e.g., `bgColor=222222`) |\n| `textColor` | Text color (e.g., `textColor=FFFFFF`) |\n| `borderColor` | Border color (e.g., `borderColor=FF0000`) |\n\n#### Example:\n```markdown\n![GitHubViewsCounter](https://openlabx.com/githubviewscounter/api/gitvcr.php?username=openlab-x\u0026repository=OpenQRCode\u0026bgColor=333333\u0026textColor=00FF00\u0026borderColor=FF0000)\n```\n\n---\n\n## Technology Stack\n\n- **PHP**: Core backend logic for real-time tracking and dynamic image generation.\n- **GD Library**: Creates visually appealing and customizable counters.\n- **GitHub Proxy Handling**: Ensures compatibility with GitHub’s camo.githubusercontent.com proxy for image requests.\n- **cURL**: Validates repositories and usernames by sending an **HTTP HEAD request**.\n- **JSON**: Lightweight storage for tracking data.\n- **HTML/Markdown**: For embedding counters into GitHub README files.\n- **Custom Theming**: Allows developers to specify colors and styles dynamically via URL parameters.\n\n\n\n\n## Challenges and Design Decisions\n\n1. **No Country-Based Tracking**\n   - GitHub proxies images, masking visitor IPs. As a result, geolocation is impossible, as we wanted to display the views as based on country locations and show more details.\n   - To maintain simplicity and privacy, GitHubViewsCounter focuses solely on view counts.\n\n2. **Repository and Username Validation**\n   - Ensures users cannot add repositories or usernames they don’t own by sending **HTTP HEAD requests** to validate the URLs.\n\n3. **Dynamic Calculations**\n   - Total views and repository-specific views are recalculated dynamically for accuracy.\n\n4. **Modular Design**\n   - Separate scripts handle profile-wide counters (`gitvcmp.php`) and repository-specific counters (`gitvcr.php`).\n\n\n\n\n## Contributing\n We welcome contributions! Here's how you can help:\n\n  1. Give the project a STAR.\n  2. Follow us on Github.\n  3. Follow us on Social Media.\n  4. Fork the repository.\n  5. Create a new branch for your feature or bug fix.\n  6. Make your changes.\n  7. Submit a pull request.\n  8. Please make sure to update tests as appropriate.\n\n## Acknowledgments\n\nSpecial thanks to the **OpenLabX Team** for developing this project and to all contributors.\n\n\n\n## Bug Reporting\n\nIf you encounter a bug:\n1. Create an issue in the [GitHub Repository](https://github.com/openlab-x/GitHubViewsCounter/issues).\n2. Provide a detailed description, including steps to reproduce the issue.\n\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n\n\n## Code of Conduct\n\nWe aim to maintain a welcoming environment. Please follow our [Code of Conduct](CODE_OF_CONDUCT.md).\n\n\n## Contact\n\nFor inquiries, reach out to the **OpenLabX Team**:\n\n- Website: [https://openlabx.com](https://openlabx.com)\n- Email: contact@openlabx.com\n\n\n\n**Follow Us:**\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://www.instagram.com/openlabx_official/\" target=\"_blank\"\u003e\u003cstrong\u003eInstagram\u003c/strong\u003e\u003c/a\u003e |\n\u003ca href=\"https://x.com/openlabx\" target=\"_blank\"\u003e\u003cstrong\u003eX (formerly Twitter)\u003c/strong\u003e\u003c/a\u003e |\n\u003ca href=\"https://www.facebook.com/openlabx/\" target=\"_blank\"\u003e\u003cstrong\u003eFacebook\u003c/strong\u003e\u003c/a\u003e |\n\u003ca href=\"https://www.youtube.com/@OpenLabX\" target=\"_blank\"\u003e\u003cstrong\u003eYouTube\u003c/strong\u003e\u003c/a\u003e |\n\u003ca href=\"https://github.com/openlab-x\" target=\"_blank\"\u003e\u003cstrong\u003eGitHub\u003c/strong\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlab-x%2Fgithubviewscounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenlab-x%2Fgithubviewscounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenlab-x%2Fgithubviewscounter/lists"}