convert tabs to spaces
This commit is contained in:
parent
980e40c819
commit
47507799d4
1 changed files with 10 additions and 10 deletions
20
app.py
20
app.py
|
@ -8,20 +8,20 @@ cache=Cache(app)
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
return render_template("map.html")
|
return render_template("map.html")
|
||||||
|
|
||||||
@app.route("/gas.svg")
|
@app.route("/gas.svg")
|
||||||
def favicon():
|
def favicon():
|
||||||
return send_from_directory(app.static_folder,"gas.svg")
|
return send_from_directory(app.static_folder,"gas.svg")
|
||||||
|
|
||||||
@app.route("/gas.csv")
|
@app.route("/gas.csv")
|
||||||
@cache.cached(timeout=1800)
|
@cache.cached(timeout=1800)
|
||||||
def gas():
|
def gas():
|
||||||
result=["Sams https://www.samsclub.com/local/fuel-center/-/X"]
|
result=["Sams https://www.samsclub.com/local/fuel-center/-/X"]
|
||||||
url='https://www.samsclub.com/api/node/vivaldi/browse/v2/clubfinder/list?distance=10000&nbrOfStores=1000&singleLineAddr=10001'
|
url='https://www.samsclub.com/api/node/vivaldi/browse/v2/clubfinder/list?distance=10000&nbrOfStores=1000&singleLineAddr=10001'
|
||||||
sams=requests.get(url,headers={'User-Agent':'Mozilla/5.0','Accept-Encoding':'ztsd'}).json()
|
sams=requests.get(url,headers={'User-Agent':'Mozilla/5.0','Accept-Encoding':'ztsd'}).json()
|
||||||
for s in sams:
|
for s in sams:
|
||||||
if 'gasPrices' in s:
|
if 'gasPrices' in s:
|
||||||
p={g['gradeId']:int(g['price']*100) for g in s['gasPrices']}
|
p={g['gradeId']:int(g['price']*100) for g in s['gasPrices']}
|
||||||
result.append(f"{p[11]},{p[16]},{s['geoPoint']['latitude']},{s['geoPoint']['longitude']},{s['id']}")
|
result.append(f"{p[11]},{p[16]},{s['geoPoint']['latitude']},{s['geoPoint']['longitude']},{s['id']}")
|
||||||
return "\n".join(result)
|
return "\n".join(result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue