{"id":28000467,"url":"https://github.com/andmos/bikesharefunction","last_synced_at":"2025-05-08T23:53:07.408Z","repository":{"id":38354028,"uuid":"171523617","full_name":"andmos/BikeshareFunction","owner":"andmos","description":"OpenFaaS function for BikeshareClient","archived":false,"fork":false,"pushed_at":"2023-03-10T04:58:09.000Z","size":102,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T23:53:00.142Z","etag":null,"topics":["bikeshare","dotnet","functions","gbfs","openfaas","serverless"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andmos.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}},"created_at":"2019-02-19T18:04:15.000Z","updated_at":"2021-06-24T05:59:18.000Z","dependencies_parsed_at":"2022-08-25T05:00:38.837Z","dependency_job_id":"bdfa9f73-8de9-4434-b1ef-285c7d7e191a","html_url":"https://github.com/andmos/BikeshareFunction","commit_stats":{"total_commits":94,"total_committers":3,"mean_commits":"31.333333333333332","dds":0.4893617021276596,"last_synced_commit":"e23f2a962908bf8bed0ac5d166be7e62cd5c14db"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andmos%2FBikeshareFunction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andmos%2FBikeshareFunction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andmos%2FBikeshareFunction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andmos%2FBikeshareFunction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andmos","download_url":"https://codeload.github.com/andmos/BikeshareFunction/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166489,"owners_count":21864471,"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":["bikeshare","dotnet","functions","gbfs","openfaas","serverless"],"created_at":"2025-05-08T23:53:06.698Z","updated_at":"2025-05-08T23:53:07.387Z","avatar_url":"https://github.com/andmos.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"BikeshareFunction\n===\n\n[OpenFaaS](https://www.openfaas.com/) function for [BikeshareClient](https://github.com/andmos/BikeshareClient) access.\nProvides a simple serverless [GBFS](https://github.com/NABSA/gbfs) status system.\n\n`gbfs-systems-function` parses the [GBFS Systems CSV](https://raw.githubusercontent.com/NABSA/gbfs/master/systems.csv) to JSON, providing API for systems overview.\n\n```bash\nfaas-cli template pull https://github.com/burtonr/csharp-kestrel-template\nfaas-cli build -f bikeshare-function.yml\n\nfaas-cli deploy -f bikeshare-function.yml\n\necho \"skansen\" |faas-cli invoke bikeshare-function |jq\n# {\n#  \"Name: \"skansen\",\n#  \"BikesAvailable\": 18,\n#  \"LocksAvailable\": 0\n# }\n\necho |faas-cli invoke gbfs-systems-function |jq\n#{\n#    \"CountryCode\": \"US\",\n#    \"Name\": \"Sobi Long Beach\",\n#    \"Location\": \"Long Beach, NY\",\n#    \"Id\": \"sobi_long_beach\",\n#    \"Url\": \"http://sobilongbeach.com/\",\n#    \"GBFSFileUrl\": \"http://sobilongbeach.com/opendata/gbfs.json\"\n#  }\n```\n\nChange GBFS system by updating the `GBFSAddress` variable:\n\n```bash\nfaas-cli deploy -f bikeshare-function.yml --env=GBFSAddress=https://gbfs.urbansharing.com/oslobysykkel.no/gbfs.json update=true\necho \"Diakonhjemmet\" |faas-cli invoke bikeshare-function\n# {\n#  \"Name: \"Diakonhjemmet\",\n#  \"BikesAvailable\": 9,\n#  \"LocksAvailable\": 5\n# }\n```\n\nThis project also contains function to post from `bikeshare-function` to Slack. Add a new bot named `bikesharebot` to a Slack workspace, and update the variable under `bikeshare-slack-function:` in `bikeshare-function.yml` with the location of the [OpenFaaS gateway](https://github.com/openfaas/workshop/blob/master/lab4.md#call-one-function-from-another):\n\n```yaml\nenvironment:\n    gateway_hostname: http://gateway:8080/\n```\n\nAdd the bot's OAUTH token to [OpenFaaS secrets](https://docs.openfaas.com/reference/secrets/):\n\n```shell\nfaas-cli secret create bikebotslacktoken --from-file=slackbot-key.txt\n```\n\nand initialize the bot by trigging the function after deploy:\n\n```shell\necho \"init\" |faas-cli invoke bikeshare-slack-function\n# Bot initializing\n```\n\nNow simply ask the bot for a station:\n\n```shell\nandmos [8:40 PM]\n@BikeshareBot Lerkendal\nBikeshareBot APP [8:40 PM]\nLerkendal: :bike:: 17 :unlock:: 3\n```\n\nTo run OpenFaaS, look at the guides for [Docker Swarm](https://docs.openfaas.com/deployment/docker-swarm/), [Kubernetes](https://docs.openfaas.com/deployment/kubernetes/) or [OpenShift](https://docs.openfaas.com/deployment/openshift/).\n\n[![Build Status](https://github.com/andmos/bikesharefunction/workflows/Publish/badge.svg)](https://github.com/andmos/BikeshareFunction/actions?query=workflow%3APublish)\n\n[![Dependabot Status](https://api.dependabot.com/badges/status?host=github\u0026repo=andmos/BikeshareFunction)](https://dependabot.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandmos%2Fbikesharefunction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandmos%2Fbikesharefunction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandmos%2Fbikesharefunction/lists"}