{"id":37995134,"url":"https://github.com/jmesserli/slack-publictransport-java","last_synced_at":"2026-01-16T18:48:43.449Z","repository":{"id":10360150,"uuid":"65488633","full_name":"jmesserli/slack-publictransport-java","owner":"jmesserli","description":"REST API implemented in Java for a Slack App which provides public transport information for Switzerland","archived":false,"fork":false,"pushed_at":"2025-07-11T21:55:13.000Z","size":178,"stargazers_count":0,"open_issues_count":28,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-07-11T23:33:59.713Z","etag":null,"topics":["jax-rs","jersey","opendata","slack","switzerland","transport-api","transport-information","webhook"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/jmesserli.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}},"created_at":"2016-08-11T17:31:45.000Z","updated_at":"2018-06-17T07:03:39.000Z","dependencies_parsed_at":"2025-07-11T23:27:44.308Z","dependency_job_id":"20c71240-3e94-4b68-999c-cc64fe8cc9d9","html_url":"https://github.com/jmesserli/slack-publictransport-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmesserli/slack-publictransport-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmesserli%2Fslack-publictransport-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmesserli%2Fslack-publictransport-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmesserli%2Fslack-publictransport-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmesserli%2Fslack-publictransport-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmesserli","download_url":"https://codeload.github.com/jmesserli/slack-publictransport-java/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmesserli%2Fslack-publictransport-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jax-rs","jersey","opendata","slack","switzerland","transport-api","transport-information","webhook"],"created_at":"2026-01-16T18:48:42.701Z","updated_at":"2026-01-16T18:48:43.437Z","avatar_url":"https://github.com/jmesserli.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-publictransport-java :train2:\n\nA Slack app that provides users in Switzerland with public transport information. The source for this information is the [Opendata Transport API](http://transport.opendata.ch/docs.html).\n\nIf you want to use this for your own Slack, you can either use the instance at [slack-publictransport-api2.jmnw.me](slack-publictransport-api2.jmnw.me) and add it by clicking the Slack button on that page. To host your own instance, proceed to the **Installation** section.\n\n## Installation :rocket:\n\nSlack does not allow the creation of app commands if there is no page listening for the command, so we will first deploy the application without much configuration and then register the Slack app, so that we can finish the configuration.\n\n### Server setup :wrench:\n\nTo allow the application to run, you have to copy `src/main/resources/config.example.properties` to `src/main/resources/config.properties` since this file is required when the application starts up. \n\nYou can then run a [Maven](https://maven.apache.org/) install by running `mvn install` in the project root folder. This will generate a `slack-publictransport.war` file in the `target` folder. Deploy this WAR somewhere internet-accessible on your preferred container (tested only on Tomcat 8). Note that you **must** provide the application over a secured connection (https) because Slack enforces this. You can use e.g. Nginx to terminate the secured connection and proxy to the unsecured application. **From now on, I will use `$BASE` whenever you need to enter the secure URL you deployed the WAR at for simplicity.**\n\n### Slack setup :comment:\n\nWe can now register our application on Slack's [Your Apps](https://api.slack.com/apps) page by clicking `Create New App`. Enter a snarky app name and click on `Create App`.\n\nThe next step is to set up the OAuth URL. For this, click on `OAuth \u0026 Permissions` in the lefthand menu. In the generous `Redirect URL(s)` field there, enter `$BASE/api/v1/oauth`. \n\nAfter you have `Save Changes`d, we will move on to `Interactive Messages`. On that page, all you need to do is click `Enable Interactive Messages`, enter `$BASE/api/v1/interactive` and click `Enable Interactive Messages` once again.\n\nWe will now create the actual command on the `Slash Commands` page. The `Create New Command` button is your friend which opens up quite a form. The only thing that is a given is the `Request URL`, which needs to be set to `$BASE/api/v1/connections`. You can customize the rest to your likings. The syntax for the parameters is `\"from\" \"to\" (time[an|ab]) ` where the quotation marks are optional if the name of the station is only one word and time is in the format HH:mm.\n\n### Configuring the server :fast:\n\nFor the final part, open the `Basic Information` page for your Slack app. You should be able to find `Client ID`,  `Client Secret` and `Verification Token` on this page. Those correspond to `slack.client.id`, `slack.client.secret` and `slack.server.token` in the configuration file `src/main/resources/config.properties` which you can now set to the correct values. \n\nAfter that you also have to update the `Client ID` in `src/main/webapp/index.jsp`:\n\n```html\n\u003c!-- ... --\u003e\n\u003ca href=\"https://slack.com/oauth/authorize?scope=commands\u0026client_id=\u003cYour client id here\u003e\"\u003e\n\u003c!-- ... --\u003e\n```\n\nRun a Maven install and redeploy your app. By visiting `$BASE` and clicking on the Slack button, you should be able to add the application to your team's Slack. Congratulations! ​:smiley:​","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmesserli%2Fslack-publictransport-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmesserli%2Fslack-publictransport-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmesserli%2Fslack-publictransport-java/lists"}