From cdcaca3d1324efd8db5041bcb3dfcb774cbf4c3b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 19 Aug 2021 07:32:38 +0200 Subject: [PATCH] sneed --- giphy.py | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 giphy.py diff --git a/giphy.py b/giphy.py deleted file mode 100644 index 28b2bfadf1..0000000000 --- a/giphy.py +++ /dev/null @@ -1,22 +0,0 @@ -from flask import * -from os import environ -import requests - -from files.__main__ import app - -GIPHY_KEY = environ.get('GIPHY_KEY').rstrip() - - -@app.route("/giphy", methods=["GET"]) -@app.route("/giphy", methods=["GET"]) -def giphy(): - - searchTerm = request.args.get("searchTerm", "") - limit = int(request.args.get("limit", "")) - if searchTerm and limit: - url = f"https://api.giphy.com/v1/gifs/search?q={searchTerm}&api_key={GIPHY_KEY}&limit={limit}" - elif searchTerm and not limit: - url = f"https://api.giphy.com/v1/gifs/search?q={searchTerm}&api_key={GIPHY_KEY}&limit=48" - else: - url = f"https://api.giphy.com/v1/gifs?api_key={GIPHY_KEY}&limit=48" - return jsonify(requests.get(url).json()) \ No newline at end of file