Created
September 20, 2018 21:42
-
-
Save alanzchen/2b7d2bfb5681505c193207ae400e767d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
# coding=utf-8 | |
""" | |
# <bitbar.title>Next Train Home</bitbar.title> | |
# <bitbar.version>v1</bitbar.version> | |
# <bitbar.author>alan</bitbar.author> | |
# <bitbar.author.github>alanzchen</bitbar.author.github> | |
# <bitbar.desc> | |
# The next train home. | |
# </bitbar.desc> | |
""" | |
import requests | |
resp = requests.get("http://svc.metrotransit.org/NexTrip/902/2/WEBK?format=json").json() | |
print(resp[0]['DepartureText'].replace(' Min', 'm')) | |
print("---") | |
for i in resp[1:]: | |
print(i['DepartureText']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment