Skip to content

Commit

Permalink
Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
engagepy committed Sep 7, 2021
1 parent ef8c422 commit b8bf7d0
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 21 deletions.
Binary file modified __pycache__/crypto.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/flight.cpython-38.pyc
Binary file not shown.
Binary file modified __pycache__/weathers.cpython-38.pyc
Binary file not shown.
12 changes: 9 additions & 3 deletions crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@ def coin():
'x-rapidapi-key': "ca396c8c62mshf51f177a6611b4ap1cf15ajsnb909632c0ce7"
}

response = requests.request("POST", url, data=payload, headers=headers)
response = requests.request(
"POST", url, data=payload,
headers=headers)
datas = response.json()
token = datas['access_token']


print(response.text)

url = "https://bravenewcoin.p.rapidapi.com/market-cap"
querystring = {"assetId":" f1ff77b6-3ab4-4719-9ded-2fc7e71cff1f"}
querystring = {
"assetId":" f1ff77b6-3ab4-4719-9ded-2fc7e71cff1f"
}
headers = {
'authorization': f"Bearer {token}",
'x-rapidapi-host': "bravenewcoin.p.rapidapi.com",
'x-rapidapi-key': "ca396c8c62mshf51f177a6611b4ap1cf15ajsnb909632c0ce7"
}
response = requests.request("GET", url, headers=headers, params=querystring)
response = requests.request(
"GET", url, headers=headers,
params=querystring)
dic = response.json()
print(dic)

Expand Down
4 changes: 3 additions & 1 deletion flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
def flight_message(arrival, departure):
url = f"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/IN/INR/en-US/{departure}-sky/{arrival}-sky/anytime"

querystring = {"inboundpartialdate": "2019-12-01"}
querystring = {
"inboundpartialdate": "2019-12-01"
}

headers = {
'x-rapidapi-key': "ca396c8c62mshf51f177a6611b4ap1cf15ajsnb909632c0ce7",
Expand Down
33 changes: 26 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ def user():
db['password'] += password
form.password.data = ''
flash("Cool, you're signed up ")
return render_template('user.html', name = name, form = form)
return render_template(
'user.html', name = name,
form = form
)

@app.route('/iss', methods=['GET', 'POST'])
def iss_page():
Expand All @@ -85,7 +88,10 @@ def iss_page():
name = form.name.data
form.name.data = ''
flash(iss.message())
return render_template('iss.html', name=name, form=form)
return render_template(
'iss.html', name=name,
form=form
)

@app.route('/tax', methods=['GET', 'POST'])
def tax_page():
Expand All @@ -107,7 +113,11 @@ def tax_page():

flash('Total, Tax, Pre-Tax Total & Tax Amount - That Easy! Refer Us. ')

return render_template('tax.html', total=total,tax=tax,pre_tax=round(pre_tax, 2),tax_amount=round(tax_amount, 2),form=form)
return render_template(
'tax.html', total=total,tax=tax,
pre_tax=round(pre_tax, 2),tax_amount=round(tax_amount, 2),
form=form
)

@app.route('/flight', methods=['GET', 'POST'])
def flight_page():
Expand All @@ -126,7 +136,10 @@ def flight_page():
flash(x[1])
#os.system("python iss.py")
#iss.send_msg(number)
return render_template('flights.html',arrival=arrival,departure=departure,form=form)
return render_template(
'flights.html',arrival=arrival,
departure=departure,form=form
)

@app.route('/weathers', methods=['GET', 'POST'])
def weathery():
Expand All @@ -140,7 +153,10 @@ def weathery():
flash(x)
#os.system("python iss.py")
#iss.send_msg(number)
return render_template('weather.html',name=name,form=form)
return render_template(
'weather.html',
name=name,form=form
)

@app.route('/crypto', methods=['GET', 'POST'])
def btc():
Expand All @@ -157,7 +173,10 @@ def btc():
flash(result[3])
flash(result[4])
flash(result[5])
return render_template('crypto.html', name = name, form = form)
return render_template(
'crypto.html', name = name,
form = form
)

if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=8080)
app.run(debug=False, host='0.0.0.0', port=8080)
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<title>Liven-IT-Up!</title>
<title> Liven-IT-Up! </title>
</head>
<body>
{% include 'nav.html' %}
Expand Down
2 changes: 1 addition & 1 deletion templates/crypto.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h3>Live BitCoin Updates</h3>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
2 changes: 1 addition & 1 deletion templates/flights.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h3>Best Fly Prices & Dates : Any Airport Code Works! [eg: Del - CCU - ixz]</h3>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
2 changes: 1 addition & 1 deletion templates/iss.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h3> An Update From SPACE! </h3>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
2 changes: 1 addition & 1 deletion templates/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</style>

<div class="alert alert-primary" role="alert">
<h2> LivenIT - What is it ?
<h2> Liven-IT | What is it ?
</h2>

<hr>
Expand Down
2 changes: 1 addition & 1 deletion templates/tax.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h2>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
2 changes: 1 addition & 1 deletion templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1> The LivenIT Community!</h1>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
2 changes: 1 addition & 1 deletion templates/weather.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h3>Live Weather Data - Any City ! [eg: New York, London, Port Blair]</h3>

<p></p>

{{form.submit(class="btn btn-dark")}}
{{form.submit(class="btn btn-outline-info")}}


</form> </b>
Expand Down
8 changes: 6 additions & 2 deletions weathers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
def weather(city):
url = "https://community-open-weather-map.p.rapidapi.com/find"

querystring = {"q":f"{city}","cnt":"1","mode":"html","lon":"0","type":"accurate","lat":"0","units":"metric"}
querystring = {
"q":f"{city}","cnt":"1","mode":"html","lon":"0","type":"accurate","lat":"0","units":"metric"
}

headers = {
'x-rapidapi-host': "community-open-weather-map.p.rapidapi.com",
'x-rapidapi-key': "ca396c8c62mshf51f177a6611b4ap1cf15ajsnb909632c0ce7"
}

response = requests.request("GET", url, headers=headers, params=querystring)
response = requests.request(
"GET", url, headers=headers,
params=querystring)
dic = response.json()
print(dic)
data = dic['list']
Expand Down

0 comments on commit b8bf7d0

Please sign in to comment.