[Tutor] SOS pleas help

Deshaun Williams deshwill at iu.edu
Mon Dec 6 09:59:26 EST 2021


im trying to code a web application to use API but i cant get it to work
heres my current code. <%
import math, json
from bottle import request, route
url = "https://www.gamerpower.com/api/giveaways?platform=pc"
r = request.get(url)
request.forms.get("cosnole")
gamer = request.forms.get("cosnole")
pathstring =""
if gamer == "pc":
    pathstring = ('/pc.html')
elif gamer == "switch":
    pathstring == ('/switch.html')
end
response =  request.get("
https://www.gamerpower.com/api/giveaways?platform=pc")
data = json.load(response)
        # write the results in a csv file
%>
<html>
<html lang = "en-us">
<head></head>
<h1> nothing</h1>
<style>
<body>
<div>
{{data()}}
</div>
</body>



</style>
</html>
any help you can give would be grealy appreciated


More information about the Tutor mailing list