|
@ -140,8 +140,8 @@ def add_other_db(timestamp,seedText,request_type): |
|
|
|
|
|
|
|
|
@app.route('/', methods=['GET']) |
|
|
@app.route('/', methods=['GET']) |
|
|
def home(): |
|
|
def home(): |
|
|
return '''<h1>Queer API</h1> |
|
|
return '''<h1>Queer Motto API: To know exactly how many times to cry</h1> |
|
|
<p>A prototype API.</p>''' |
|
|
<a href="https://gitlab.com/siusoon/queer-motto-api">https://gitlab.com/siusoon/queer-motto-api</a>''' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/queermottoAPI/r1/refusal', methods=['GET']) |
|
|
@app.route('/queermottoAPI/r1/refusal', methods=['GET']) |
|
@ -173,10 +173,13 @@ def api_args(): |
|
|
orgVal = str(request.args['org']) |
|
|
orgVal = str(request.args['org']) |
|
|
orgVal = bytes(orgVal, encoding='utf-8') |
|
|
orgVal = bytes(orgVal, encoding='utf-8') |
|
|
if (rqstr == "generate" and orgVal == f1.decrypt(secrettoken1)) or (rqstr == "generate" and orgVal == f2.decrypt(secrettoken2)): |
|
|
if (rqstr == "generate" and orgVal == f1.decrypt(secrettoken1)) or (rqstr == "generate" and orgVal == f2.decrypt(secrettoken2)): |
|
|
|
|
|
# Here we match the token to the organisation |
|
|
if orgVal == f1.decrypt(secrettoken1): |
|
|
if orgVal == f1.decrypt(secrettoken1): |
|
|
org = "transmediale" |
|
|
org = "transmediale" |
|
|
elif orgVal == f2.decrypt(secrettoken2): |
|
|
elif orgVal == f2.decrypt(secrettoken2): |
|
|
org = "test" |
|
|
org = "test" |
|
|
|
|
|
# Another token can be added here |
|
|
|
|
|
|
|
|
# Generate the motto |
|
|
# Generate the motto |
|
|
api_phrase_str = '' |
|
|
api_phrase_str = '' |
|
|
for i in range(len(seedTextList)): |
|
|
for i in range(len(seedTextList)): |
|
|