Last active
December 19, 2015 02:18
-
-
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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