diff --git a/app/api.py b/app/api.py index ebc44554129aea6027a982402db65216946ea83a..d8d5dd2f4d545373963cb012a17ab54e377da165 100644 --- a/app/api.py +++ b/app/api.py @@ -1,6 +1,5 @@ from flask import jsonify, render_template from sqlite3 import connect -from makeqr import makeQR def apiGet(request, url_scheme, s, sAPI, passwordProtected): try: @@ -72,20 +71,10 @@ def apiPost(request, url_scheme, domain, sAPI, passwordProtected, password): 'INSERT INTO WEB_URL (LONG_URL, SHORT_URL, USERNAME) VALUES (?, ?, ?)', [longURL, short, username] ) - try: - request.form['qr'] - qr64 = "data:image/jpeg;base64," + makeQR(url_scheme + "://" + short) - - return jsonify( - status="0", - message="ok", - qr=qr64 - ) - except: - return jsonify( - status="0", - message="ok" - ) + return jsonify( + status="0", + message="ok" + ) else: return jsonify( status="4", diff --git a/app/templates/apiDocs.html b/app/templates/apiDocs.html index 915e9b49c4f566e802ca8842562268b9a05e884b..2d5c8698e9f3b229f65670834414ac7e6d74aeee 100644 --- a/app/templates/apiDocs.html +++ b/app/templates/apiDocs.html @@ -56,7 +56,6 @@ <ul> <li>short: the short URL you want to get. example: {{domain}}/example</li> <li>long: the long URL you want to short</li> - <li>qr: if you add this parameter you will get an base64 encoded QR code image</li> <li>apikey: you can add this argument, if you want to assign this link to your account.</li> {% if passwordProtected %} <li>password: this value contains the password, that is needed to short a link.</li> @@ -69,7 +68,6 @@ <ul> <li>status: The status code of the reponse. Down there is a table with the posible response codes</li> <li>message: This argument will do the same like the status code, but it is written out, for reading by human.</li> - <li>qr: If you enabled this argument, the response will include a QR code of the shorten link as base64 coded jpeg image</li> </ul> <br> @@ -107,10 +105,4 @@ {% endif %} </table> - - <br> - <h2>Preview image</h2> - <p>Please paste your base64 image here: <input type="text" id="base64Input"> <button onclick='document.getElementById("base64Image").src = document.getElementById("base64Input").value;'>show</button><br> - <smaller>(this will not work very well in google Chrome)</smaller></p> - <img id="base64Image"> </body> \ No newline at end of file