Skip to content

Instantly share code, notes, and snippets.

@abloch
Created January 16, 2017 03:46
Show Gist options
  • Save abloch/cd51d1cead5224c5e799ccbc9e13017a to your computer and use it in GitHub Desktop.
Save abloch/cd51d1cead5224c5e799ccbc9e13017a to your computer and use it in GitHub Desktop.
#!/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)
@povesma
Copy link

povesma commented Nov 12, 2020

It seems that http://mabat.mot.gov.il is not available any more. What's instead?

@abloch
Copy link
Author

abloch commented Jan 16, 2021

I think it's back now (sorry for the delayed reply)

@povesma
Copy link

povesma commented Jun 16, 2021

Is it down again?..

@povesma
Copy link

povesma commented Jun 17, 2021

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