Created
January 16, 2017 03:46
-
-
Save abloch/cd51d1cead5224c5e799ccbc9e13017a to your computer and use it in GitHub Desktop.
This file contains 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/env python3 | |
import requests | |
import json | |
import pprint | |
from datetime import datetime | |
pp = pprint.PrettyPrinter(indent=4) | |
def get_station(station_id): | |
"""retuns a dictionary that describes the info for the given station id""" | |
url = "http://mabat.mot.gov.il/AdalyaService.svc/StationLinesByIdGet" | |
payload = {"stationId": station_id, "isSIRI":True, "lang":"1037"} | |
headers = {'Content-Type': 'application/json'} | |
r = requests.post(url, data=json.dumps(payload), headers=headers).json() | |
if not r['Success']: | |
raise("error with url {}".format(url)) | |
r['SentAt'] = datetime.now() # inject the request time into the response | |
return r | |
response = get_station(21732) | |
pp.pprint(response) |
Is it down again?..
Now it's dead officially:
משרד התחבורה הפסיק את התמיכה באפליקציית "כל קו" ובאתר הקשור אליה.
המשרד הקים אפליקציה חדשה בשם "התחנה" במקום.
Here's the app: https://play.google.com/store/apps/details?id=com.ridewithvia.zuzu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it's back now (sorry for the delayed reply)