{"id":13432622,"url":"https://github.com/ahmetb/sheets-url-shortener","last_synced_at":"2025-04-08T04:19:47.522Z","repository":{"id":39639911,"uuid":"269155924","full_name":"ahmetb/sheets-url-shortener","owner":"ahmetb","description":"A simple short URL redirect service built on top of Google Sheets, and runs for cheap on Google Cloud Run serverless.","archived":false,"fork":false,"pushed_at":"2024-02-21T19:00:48.000Z","size":54,"stargazers_count":181,"open_issues_count":4,"forks_count":40,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T08:27:55.038Z","etag":null,"topics":["cloud-run","cloud-run-button","google-cloud-run","serverless","sheets-api","url-shortener","url-shortener-microservice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmetb.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":"2020-06-03T17:47:35.000Z","updated_at":"2025-02-11T15:51:07.000Z","dependencies_parsed_at":"2024-06-21T16:30:51.255Z","dependency_job_id":"74a8c06a-f927-481d-9c3c-476ed4c0f740","html_url":"https://github.com/ahmetb/sheets-url-shortener","commit_stats":null,"previous_names":["ahmetb/serverless-url-shortener"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fsheets-url-shortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fsheets-url-shortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fsheets-url-shortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetb%2Fsheets-url-shortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetb","download_url":"https://codeload.github.com/ahmetb/sheets-url-shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773935,"owners_count":20993672,"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":["cloud-run","cloud-run-button","google-cloud-run","serverless","sheets-api","url-shortener","url-shortener-microservice"],"created_at":"2024-07-31T02:01:14.337Z","updated_at":"2025-04-08T04:19:47.496Z","avatar_url":"https://github.com/ahmetb.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"## URL Shortener with a Google Spreadsheet 📑\n\nThis is a simple web server that can redirect a pre-defined set of URLs in\nGoogle Sheets. All you need to do is define a [Google Sheets][ex] like the\nfollowing, and deploy a simple app just by clicking around.\n\n| shortcut | url |\n|----|---|\n| `gh` | `https://github.com/ahmetb` |\n| `yt` | `https://www.youtube.com/watch?v=dQw4w9WgXcQ`\n| `cv` | `https://docs.google.com/document/d/1c97PrqTFqiMpannv2/edit` |\n| `resume` | `/cv` |\n\n**Costs:** This can be deployed to [Google Cloud Run](https://cloud.run) and run\nfor **free** thanks to [generous free tier][free tier] (+Google Sheets is free\nwith a Gmail account as well).\n\n[free tier]: https://cloud.google.com/run/pricing\n\nThis redirector also supports path additions on top of base URLs, for example,\nwith the sheet row:\n\n| shortcut | url |\n|----|---|\n| `gcp` | `https://github.com/GoogleCloudPlatform` |\n\nThe `go.ahmet.dev/gcp/golang-samples` will be redirected to\n`https://github.com/GoogleCloudPlatform/golang-samples`.\n\n## Setup\n\n1. Create a new **Google Sheet**: https://sheets.new.\n\n1. Add two columns, first column is the \"shortcut\", the second\n   column is the \"url\" to redirect the user. ([see example][ex])\n\n1. Save the ID of your Sheet from the URL (it’s a random string\n   that looks like `1SMeoyesCaGHRlYdGj9VyqD-qhXtab1jrcgHZ0irvNDs`).\n\n1. Click to deploy to Cloud Run, and provide your spreadsheet\n   ID while deploying:\n\n   [![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)\n\n1. Go to https://console.cloud.google.com/run, click on\n   `sheets-url-shortener` service. Find the email address written in the\n   \"Service Account\" section.\n\n1. Go to your Google Sheets, click \"Share\" and give this email\n   address \"Viewer\" access on your sheet.\n\n1. Go to https://console.developers.google.com/apis/api/sheets.googleapis.com/overview\n   and make sure the Google Sheets API is enabled.\n\n1. (Optional) If you want to use a custom domain like `go.ahmet.dev`, go to\n   https://console.cloud.google.com/run/domains and map the\n   `sheets-url-shortener` to your custom domain!\n\n## Advanced Configuration\n\nThis server can be configured with these following parameters:\n\n| Environment Variable | Description |\n|-----|------|\n| `SHEET_NAME` | (optional) If you have multiple sheets in a spreadsheet, specify the sheet name. |\n| `CACHE_TTL` | (optional) how frequently the spreadsheet must be reloaded (default: `5s`) |\n| `HOME_REDIRECT` | (optional) which url to redirect when root url (`/`) is visited\n| `LISTEN_ADDR` | (optional) which network address to listen on (default `\"\"` which means all interfaces) |\n| `PORT` | (optional) http port to listen on (default `8080`).\n\n## Disclaimer\n\nThis is not an official Google project. It's distributed as-is under Apache 2.0\nLicense. See [LICENSE](./LICENSE).\n\n[ex]: https://docs.google.com/spreadsheets/d/1wCcj0Y4wFUHGAY0DmyefFlQ3s1DR8aUTz9seykM2iJ8/edit?usp=sharing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fsheets-url-shortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetb%2Fsheets-url-shortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetb%2Fsheets-url-shortener/lists"}