Skip to content

Instantly share code, notes, and snippets.

@alanzchen
Created September 20, 2018 21:42
Show Gist options
  • Save alanzchen/2b7d2bfb5681505c193207ae400e767d to your computer and use it in GitHub Desktop.
Save alanzchen/2b7d2bfb5681505c193207ae400e767d to your computer and use it in GitHub Desktop.
#!/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