Created
March 26, 2019 14:48
-
-
Save Lagertonne/8f9dc07bbf2003d535df2f67d5f5022d to your computer and use it in GitHub Desktop.
uestra
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
def fetch_data(station_id): | |
# generate payload | |
payload = { | |
'outputFormat': 'JSON', | |
'language': 'de', | |
'locationServerActive': 1, | |
'useRealtime': 1, | |
'anySigWhenPerfectNoOtherMatches': 1, | |
'limit': 70, | |
'deleteAssignedStops_dm': 1, | |
'mode': 'direct', | |
'convertCrossingsITKernel2LocationServer': 1, | |
'convertStopsPTKernel2LocationServer': 1, | |
'convertAddressesITKernel2LocationServer': 1, | |
'convertPOIsITKernel2LocationServer': 1, | |
'itdLPxx_dest': '', | |
'useAllStops': 1, | |
'maxAssignedStops': 1, | |
'itOptionsActive': 1, | |
'trITMOTvalue100': 5, | |
'ptOptionsActive': 1, | |
'useProxFootSearch': 0, | |
'itdLPxx_script': 'true', | |
'place_dm': '', | |
'placeState_dm': 'empty', | |
'nameState_dm': 'empty', | |
'nameInfo_dm': 'invalid', | |
'typeInfo_dm': 'invalid', | |
'placeInfo_dm': 'invalid', | |
'reducedAnyWithoutAddressObjFilter_dm': 103, | |
'reducedAnyPostcodeObjFilter_dm': 64, | |
'reducedAnyTooManyObjFilter_dm': 2, | |
'anyObjFilter_dm': 126, | |
'type_dm': 'any', | |
'name_dm': station_id} | |
#'itdTimeHour': 17, | |
#'itdTimeMinute': 30, | |
#'itdDate': 20190205} | |
r = requests.post('http://mobil.efa.de/mobile3/XSLT_DM_REQUEST', payload) | |
r.encoding = "utf-8" | |
#r.encoding = "ascii" | |
return json.loads(r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment