Skip to content

Instantly share code, notes, and snippets.

@dfinke
Last active December 19, 2015 02:18
Show Gist options
  • Save dfinke/5881721 to your computer and use it in GitHub Desktop.
Save dfinke/5881721 to your computer and use it in GitHub Desktop.
@CitibikeNYC has a JSON endpoint now I can use PowerShell to find docking stations Get-CitiBikeStations "Park Ave"
function Get-CitiBikeStations {
param($label)
$wc = New-Object net.webclient
($wc.DownloadString("http://appservices.citibikenyc.com/data2/stations.php") |
ConvertFrom-Json).results |
select label, availableBikes,availableDocks |
where label -Match $label
}
# Results
@"
label availableBikes availableDocks
----- -------------- --------------
Park Ave & St Edwards St 11 6
Washington Ave & Park Ave 16 5
Carlton Ave & Park Ave 11 6
Clermont Ave & Park Ave 11 6
E 24 St & Park Ave S 2 51
E 20 St & Park Ave 4 24
E 30 St & Park Ave S 4 26
"@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment