{"id":18725743,"url":"https://github.com/binaryage/leechgate","last_synced_at":"2025-04-12T16:24:16.698Z","repository":{"id":2544007,"uuid":"3521744","full_name":"binaryage/leechgate","owner":"binaryage","description":"Google Analytics for your S3 bucket","archived":false,"fork":false,"pushed_at":"2014-10-16T21:42:12.000Z","size":134,"stargazers_count":64,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-26T10:48:10.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.binaryage.com/labs","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binaryage.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-23T02:56:37.000Z","updated_at":"2022-09-21T16:20:01.000Z","dependencies_parsed_at":"2022-09-10T01:10:15.553Z","dependency_job_id":null,"html_url":"https://github.com/binaryage/leechgate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binaryage%2Fleechgate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binaryage%2Fleechgate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binaryage%2Fleechgate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binaryage%2Fleechgate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binaryage","download_url":"https://codeload.github.com/binaryage/leechgate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248594649,"owners_count":21130400,"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","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":[],"created_at":"2024-11-07T14:11:46.537Z","updated_at":"2025-04-12T16:24:16.669Z","avatar_url":"https://github.com/binaryage.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Analytics for your S3 bucket\n\n## Problem: \n\n\u003e I want to see my S3 bucket stats in Google Analytics\n\n## Solution: \n\n\u003e build minimalistic Heroku app which acts as a redirecting proxy which hits Google Analytics server with every visit\n\n### My motivation\n\nI host my download server for my Mac apps on Amazon S3. Also I host there XML files for Sparkle updater. I want analytics!\n\n### How it works\n\nWhen someone requests http://downloads.binaryage.com/TotalTerminal-1.2.3.dmg, it goes to Heroku app, which:\n\t\n  1. parses URL into domain, product and version (download.binaryage.com, TotalTerminal, 1.2.3)\n  2. hits Google Analytics with event (category=domain, action=product, label=version)\n  3. redirects to http://downloads-1.binaryage.com/TotalTerminal-1.2.3.dmg (HTTP 307)\n  \n### In Action\n\n\t\t➔ curl -I http://downloads.binaryage.com/TotalTerminal-1.2.3.dmg\n\t\t\n        HTTP/1.1 307 Temporary Redirect\n\t\tContent-Type: text/html\n\t\tDate: Fri, 09 Mar 2012 10:20:59 GMT\n\t\tLocation: http://downloads-1.binaryage.com/TotalTerminal-1.2.3.dmg\n\t\tServer: Apache/2.2.19 (Unix) PHP/5.3.6\n\t\tX-Powered-By: PHP/5.3.6\n\t\tConnection: keep-alive  \n\n### Installation\n  \n  * DNS, S3\n    * originally:\n      * had S3 bucket: `downloads.binaryage.com`\n\t  * had DNS mapping: `downloads.binaryage.com` (DNS) -\u003e `downloads.binaryage.com.s3.amazonaws.com` (S3 bucket)\n\n    * newly:\n      * created new Heroku app: `binaryage-leechgate` with content of this repo\n      * created new S3 bucket: `downloads-1.binaryage.com`\n\t  * copied S3 bucket content: from `downloads.binaryage.com` to `downloads-1.binaryage.com`\n\t  * set new DNS mapping: `downloads-1.binaryage.com` (DNS) -\u003e `downloads-1.binaryage.com.s3.amazonaws.com` (S3 bucket)\n\t  * modified original DNS mapping: `downloads.binaryage.com` (DNS) -\u003e `binaryage-leechgate.herokuapp.com` (Heroku)\n\n  * Heroku\n\t* fork \u0026 clone\n\t* edit _config.php\n\t* `git commit`\n\n\t* `heroku create --stack cedar`\n    * `heroku config:add LEECHGATE_GAID=YOUR_GOOGLE_ANALYTICS_ID`\n    * `git push heroku master` \n\t\t\n    * [http://devcenter.heroku.com/articles/config-vars]()\n\t* [http://devcenter.heroku.com/articles/custom-domains]()","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryage%2Fleechgate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinaryage%2Fleechgate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinaryage%2Fleechgate/lists"}