Created
June 11, 2019 10:10
-
-
Save juanriaza/797a159ff7871b2efc5c9d83181adb16 to your computer and use it in GitHub Desktop.
bicimad stations
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
import json | |
import gzip | |
import requests | |
import binascii | |
response = requests.post( | |
'https://api.bicimad.com/emt_v10/', | |
json={ | |
"app_hash":"c26a08fe1d186dad371881fd6a3fab29438a8c48_com.emtmadrid.bicimad.gestion2", | |
"compressed":"true", | |
"encode":"base64", | |
"function":"get_stations", | |
"station":"0"}, | |
headers={'Content-Type': 'application/json; charset=UTF-8', 'User-Agent': 'okhttp/3.3.0'}) | |
raw_data = response.json()['data'] | |
data = gzip.decompress(binascii.a2b_base64(raw_data.encode())) | |
print(json.loads(data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment