{"id":24747886,"url":"https://github.com/codingitwrong/shorten_rb","last_synced_at":"2025-10-10T16:31:35.712Z","repository":{"id":97570704,"uuid":"499818617","full_name":"CodingItWrong/shorten_rb","owner":"CodingItWrong","description":"A simple Rails link shortener that respects privacy. Easy to self-host on Heroku.","archived":false,"fork":false,"pushed_at":"2025-01-16T12:54:37.000Z","size":242,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-16T14:19:35.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/CodingItWrong.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}},"created_at":"2022-06-04T12:23:11.000Z","updated_at":"2025-01-16T12:54:37.000Z","dependencies_parsed_at":"2023-10-01T16:16:40.585Z","dependency_job_id":"fad22056-3561-43c5-a617-153b839089b9","html_url":"https://github.com/CodingItWrong/shorten_rb","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/CodingItWrong%2Fshorten_rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodingItWrong%2Fshorten_rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodingItWrong%2Fshorten_rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodingItWrong%2Fshorten_rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodingItWrong","download_url":"https://codeload.github.com/CodingItWrong/shorten_rb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235964793,"owners_count":19073479,"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":"2025-01-28T05:18:03.540Z","updated_at":"2025-10-10T16:31:30.419Z","avatar_url":"https://github.com/CodingItWrong.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shorten_rb\n\nA simple Rails link shortener that respects privacy. Easy to self-host on Heroku.\n\n## Requirements\n\n- Ruby\n- Postgres\n\n## Installation\n\n`bin/setup`\n\n## Running\n\n`rails s`\n\n## Usage\n\nRedirects are configured with the `Link` model. A `Link` has the following attributes:\n\n- `slug`, the segment in the URL. When running locally this will be at `http://localhost:3000/[slug]`, and in production it will be the path under your deployed server\n- `destination`, the full URL to redirect to\n- An optional `domain`, which limits the slug matching to a single domain. This allows you to point multiple domains to the same deployed instance, and have the same slug on different domains go to different destinations\n\nThere is no user interface for configuring `Link`s; use the Rails console.\n\nRedirects are always sent as `302 Found`. This ensures they aren't permanently cached, so you can change the redirect later.\n\nAccesses are logged as a `Hit` model. No information about the request is logged except for the time the request was made.\n\n## Helpful Queries\n\nNumber of hits per link:\n\n```ruby\nLink.select('links.id, domain, slug, COUNT(hits.id) AS hit_count').joins(:hits).group('links.id').order('hit_count DESC').map { |l| \"#{l.domain}/#{l.slug} -- #{l.hits.count} hits\" }\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingitwrong%2Fshorten_rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodingitwrong%2Fshorten_rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingitwrong%2Fshorten_rb/lists"}