-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathone.py
41 lines (33 loc) · 901 Bytes
/
one.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import requests
import json
def get_fares(dist):
# mini, dist in km
data = []
row = {
'name': 'mini'
}
if dist <= 4:
row['estimate'] = 100
else:
row['estimate'] = round((dist - 4) * 15, 2)
data.append(row)
return data
def get_products():
url = 'https://mapibeta.olacabs.com/v2_1/location/search'
headers = {
'client': 'android',
'api-key': '@ndroid'
}
parameters = {
'user_id': 'KB9MYF7qSDSo4fNIKLbjY7tcCrmIoRi1JexP7NaisfgMSZICfRPzHT5IXw%2FD%0Aak3k64RfuNjRmCF8em1tgbyD3g%3D%3D%0A',
'latitude': 28.739053,
'longitude': 77.125025,
'tag': 'pickup',
'speed': 0.0,
'accuracy': 253.0,
'altitude': 0.0
}
response = requests.get(url, params=parameters, headers=headers)
#print response.status_code
data = response.json
#print get_products()