{"id":30775350,"url":"https://github.com/snick512/shorturl","last_synced_at":"2026-04-10T23:34:23.154Z","repository":{"id":312337629,"uuid":"1038116771","full_name":"snick512/shortURL","owner":"snick512","description":"Generate short URLs with tracking.","archived":false,"fork":false,"pushed_at":"2025-08-29T23:27:38.000Z","size":185,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-29T23:34:34.424Z","etag":null,"topics":["api","bash","php","shorturl","sqlite","stats","tracker","url","visitor"],"latest_commit_sha":null,"homepage":"https://isnick.net","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snick512.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-14T16:40:51.000Z","updated_at":"2025-08-29T23:27:41.000Z","dependencies_parsed_at":"2025-08-29T23:34:37.745Z","dependency_job_id":"9c552343-e81e-4107-8166-385b73e6949d","html_url":"https://github.com/snick512/shortURL","commit_stats":null,"previous_names":["snick512/shorturl"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/snick512/shortURL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snick512%2FshortURL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snick512%2FshortURL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snick512%2FshortURL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snick512%2FshortURL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snick512","download_url":"https://codeload.github.com/snick512/shortURL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snick512%2FshortURL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273709015,"owners_count":25153731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","bash","php","shorturl","sqlite","stats","tracker","url","visitor"],"created_at":"2025-09-05T03:48:08.384Z","updated_at":"2026-04-10T23:34:23.145Z","avatar_url":"https://github.com/snick512.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![Dashboard](https://github.com/snick512/shortURL/blob/master/dash.png?raw=true)\n\n\n# ShortURL — Simple PHP URL Shortener \u0026 Analytics\n\nA lightweight, self-hosted URL shortener with click tracking, analytics dashboard, and API.  \nStores data in SQLite and JSON files.  \n**No dependencies** beyond PHP and SQLite.\n\n---\n\n## Features\n\n- **Shorten URLs** via API\n- **Custom or auto-generated short names**\n- **Tracks visits** (IP, country, city, referrer, etc.)\n- **Analytics dashboard** (`dashboard.php`):  \n  - Total clicks, top links, top countries, time series, world map, recent visits\n- **Terminal dashboard** (`dashboard.sh`)\n- **API for adding links** (`url.php`)\n- **Clipboard integration** (`urlgen.sh`)\n- **Geolocation** via [ip-api.com](http://ip-api.com/)\n- **No external DB required** (uses SQLite)\n\n---\n\n## File Overview\n\n| File            | Purpose                                 |\n|-----------------|-----------------------------------------|\n| `index.php`     | Main redirector \u0026 visit logger          |\n| `url.php`       | API for creating short links            |\n| `api.php`       | Analytics API (JSON)                    |\n| `dashboard.php` | Web analytics dashboard                 |\n| `dashboard.sh`  | Terminal analytics dashboard            |\n| `urlgen.sh`     | Bash script to create short links       |\n| `.htaccess`     | Apache rewrite rules                    |\n| `urls.json`     | Stores short link mappings (auto-gen)   |\n| `visits.sqlite` | SQLite DB for analytics (auto-gen)      |\n\n---\n\n## Usage\n\n### 1. Requirements\n\n- PHP 7.2+ with SQLite enabled\n- Apache (or compatible web server with `.htaccess` support)\n- `jq` and `xclip` for shell scripts (optional)\n\n### 2. Setup\n\n1. **Clone or copy files to your server.**\n2. **Edit config values** in `url.php`, `index.php`, `dashboard.php`, and scripts:\n   - Set your API key(s), base URL, and dashboard password.\n3. **Ensure PHP can write to the directory** (for `urls.json` and `visits.sqlite`).\n4. **Configure your web server** to use `.htaccess` for pretty URLs.\n\n### 3. Creating Short Links\n\n- **Via API:**  \n  `GET /url.php?key=YOUR_API_KEY\u0026url=https://example.com[\u0026short=customname]`\n- **Via Bash script:**  \n  ```sh\n  ./urlgen.sh \"https://example.com\" [customname]\n\n\n**Support on [Liberapay](https://go.tyclifford.com/liberapay)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnick512%2Fshorturl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnick512%2Fshorturl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnick512%2Fshorturl/lists"}