Skip to content

Instantly share code, notes, and snippets.

@juanriaza
Created June 11, 2019 10:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save juanriaza/797a159ff7871b2efc5c9d83181adb16 to your computer and use it in GitHub Desktop.
Save juanriaza/797a159ff7871b2efc5c9d83181adb16 to your computer and use it in GitHub Desktop.
bicimad stations
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