{"id":18862701,"url":"https://github.com/zk-phi/alc-tracker","last_synced_at":"2026-02-10T15:30:20.806Z","repository":{"id":152679587,"uuid":"298014218","full_name":"zk-phi/alc-tracker","owner":"zk-phi","description":"Track drinking activity from within a slack channel","archived":false,"fork":false,"pushed_at":"2021-03-21T15:40:02.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T21:16:11.579Z","etag":null,"topics":["gas","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zk-phi.png","metadata":{"files":{"readme":"Readme.markdown","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":"2020-09-23T15:29:53.000Z","updated_at":"2021-07-05T03:44:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3af9dd9-0ccc-47d0-b82d-3d5186f7475b","html_url":"https://github.com/zk-phi/alc-tracker","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/zk-phi%2Falc-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk-phi%2Falc-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk-phi%2Falc-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zk-phi%2Falc-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zk-phi","download_url":"https://codeload.github.com/zk-phi/alc-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239808134,"owners_count":19700440,"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":["gas","slack"],"created_at":"2024-11-08T04:35:32.207Z","updated_at":"2026-02-10T15:30:20.746Z","avatar_url":"https://github.com/zk-phi.png","language":"JavaScript","readme":"# alctracker\n\nManage weekly alcohol consumption from within a Slack channel.\n\n# Setup\n## Install `clasp`\n\nThis app can easily be deployed to your Google Drive with `clasp` (an official Google Apps Script API client).\n\nSee the repository page (https://github.com/google/clasp) for install instructions.\n\nAfter installing `clasp`, log-in to your Google account with `clasp login`.\n\n## Deploy the app to your Google Drive\n### Create an empty Google Apps Script with a Spreadsheet\n\nIn your Google Drive page, create a new item of the type `Google Spreadsheet` and open.\n\nThen click `Tools \u003e Script Editor` to create an empty Apps Script project associated to the sheet.\n\nCopy the app ID (not sheet ID) in the URL:\n\n```\nhttps://script.google.com/d/\u003cthe-app-id\u003e/edit\n```\n\nFOR SECURITY REASONS, YOU MUST NOT SHARE THE ITEM (especially with Edit permission) WITH OTHERS.\n\n### Deploy the app\n\nCreate a file named `.clasp.json` in the root directory of this repository, then register your app's ID as follows:\n\n```\n{\"scriptId\":\"\u003cthe-app-id\u003e\"}\n```\n\nAfter setting `scriptId`, you can use `clasp` to deploy the app.\n\n```\nclasp push   # upload the code\nclasp deploy # publish as a webapp\n```\n\nWhen the app is deployed, a public URL is given to the deployed app.\n\nIn the GAS app page, click `Publish` \u003e `Deploy as web app` and you'll see the URL. The URL will be used to connect to Slack later.\n\n## Connect Slack app to the GAS app\n### Create a Slack app\n\nOpen the Slack API page (https://api.slack.com/) and click `Your Apps` then `Create New App`.\n\n### Authorize the GAS app to use Slack APIs\n\nIn your Slack app page,\n\n- open `OAuth \u0026 Permissions` tab\n- in `Scopes` section, click `Add an OAuth Scope` and add `files:write`\n\n  `files:write` is required to upload chart images to Slack.\n\n- from `Tokens for Your Workspace` section, copy the OAuth Access Token to the clipboard\n\nIn your GAS app page,\n\n- click `File` \u003e `Project Properties` \u003e `Script Properties` and add a property as follows:\n\n```\nKey: SLACK_ACCESS_TOKEN\nValue: \u003cpaste the Slack OAuth Access Token\u003e\n```\n\n### Enable interaction with the GAS app\n\nIn your Slack app page,\n\n- open `Interactivity \u0026 Shortcuts` tab and turn on the feature, then copy-and-paste the GAS app's public URL to the `Request URL` field\n\n- open `Basic Information` tab and copy the `Verification Token` in `App Credentials` section\n\nIn your GAS app page,\n\n- click `File` \u003e `Project Properties` \u003e `Script Properties` and add a property as follows:\n\n```\nKey: SLACK_VERIFICATION_TOKEN\nValue: \u003cthe Slack Verification Token\u003e\n```\n\n### Add a slash command or a shortcut to the Slack app\n\nIn your Slack app page, either (or both):\n\n- open `Slash Commands` tab and turn on the feature, then create a new command and copy-and-paste the GAS app's public URL to the `Request URL` field\n\n- open `Interactivity \u0026 Shortcuts` tab and create a new shortcut with callback id `add`\n\n### Add an incoming webhook to the Slack app\n\nIn your Slack app page,\n\n- open `Incoming Webhooks` tab and turn on the feature, then click `Add New Webhook to Workspace`\n\nIn your GAS app page,\n\n- click `File` \u003e `Project Properties` \u003e `Script Properties` and add a property as follows:\n\n```\nKey: SLACK_WEBHOOKURL\nValue: \u003cthe Slack webhook URL created in the Slack app page\u003e\n```\n\n```\nKey: SLACK_CHANNEL_NAME\nValue: \u003cthe Slack channel name integrated with the app\u003e\n```\n\nIn your Slack workspace,\n\n- invite the bot account for the slack app to the channel\n\n## Initialize \u0026 authorize the GAS app to use Google APIs\n\nOpen `main.gs` in the GAS app page and run `initialize` function manually from the menu `Execute` \u003e `Execute a function` \u003e `intialize`.\n\nYou'll be asked to permit the app to use Google Spreadsheet API and outgoing hooks.\n\nAfter authorization, a message will be posted to your Slack channel.\n\n## Setup triggers\n\nIn your GAS app page,\n\n- click `Edit \u003e Current project's trigger` and add a trigger which runs `doTimer` function\n\n  This function creates a spread sheet row to record today's drinks, and posts the summary of the yesterdays' to Slack\n\nMy trigger look like this:\n\n```\nfunction: doTimer\nversion: HEAD\nsource: time-based\ntype: date\ntime: \u003ctime you usually wake up\u003e\n```\n\n# Development\n\nWhen you modify the app and want to update the deployment, you can use `-i` option to redeploy without changing the public URL. If `-i` is omitted, you'll have multiple deployments with different versions, in different URLs.\n\n```\nclasp push\nclasp deploy -i \u003cdeployment ID\u003e\n```\n\nYou can see the list of deployments with `clasp deployments`:\n\n```\n$ clasp deployments\n2 Deployments.\n- \u003cdev deployment ID\u003e @HEAD\n- \u003cdeployment ID\u003e @4\n```\n\nThe first deployment tagged `@HEAD` is a read-only deployment for dev use, which always runs the latest version of the app. So you'll usually want to redeploy the second deployment.\n\nAfter creating unneeded deployments, you can also delete the deployment with `clasp undeploy \u003cID\u003e` command.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk-phi%2Falc-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzk-phi%2Falc-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzk-phi%2Falc-tracker/lists"}