lol im aevann now

This commit is contained in:
Aevann1 2021-09-16 21:06:30 +00:00
parent 14e771dea3
commit b82512f441
2 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@ GIPHY_KEY = environ.get('GIPHY_KEY').rstrip()
@app.route("/giphy", methods=["GET"])
@app.route("/giphy<path>", methods=["GET"])
def giphy():
def giphy(path=None):
searchTerm = request.args.get("searchTerm", "")
limit = int(request.args.get("limit", 48))
@ -19,4 +19,4 @@ def giphy():
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())
return jsonify(requests.get(url).json())