Citi Bike dock availability with JavaScript ES6 and Scriptable. This script queries Citi Bike's public APIs to output stations which have docks available. Citi Bike follows the General Bikeshare Feed Specification (GBFS) .
This was written in and executed in the iOS JavaScript ES6 editor and interpreter Scriptable. This allows the code to be accessed as an iOS shortcut. With a variety of triggers, you can call the script based off GPS location, and setup the output message to be read by Siri
With the Scriptable app installed, you'll see the option to reference them in shortcuts. You can pass parameters in, and send the output of your script to other steps.
Setting output as spoken from Siri | Using Current Location Latitude / Longitude |
scriptable:
- Run Bike-Status
documents:
- Speak Output
When:
- When I arrive at ${address}
Do:
- Run Shortcut Bike-Status
I set the address as 2 blocks away from where I need to decide which dock to go to and with a radius of 350'.