From dc5d5eacefee4eabcd412ee6a2cfe51dfef9c494 Mon Sep 17 00:00:00 2001 From: Scobiform Date: Sat, 20 Apr 2024 20:18:22 +0200 Subject: [PATCH] Add search for user #11 --- start.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/start.py b/start.py index 0d5a78b..4a1f727 100644 --- a/start.py +++ b/start.py @@ -214,6 +214,12 @@ async def search(): try: results = mastodon.account_search(query, limit=420) + # Filter results for same instance as user + results = [result for result in results if re.search(r"//([^/@]+)", result['url']).group(1) == instance] + # Filter results for indexable accounts + #results = [result for result in results if result['indexable'] == True] + + return jsonify(results) except Exception as e: return jsonify({'error': str(e)}), 500