From 4c8fd74900e2a9fb6e0f550a60fd4911cce7efca Mon Sep 17 00:00:00 2001 From: Adrian Maraj Date: Wed, 19 Jun 2024 10:45:58 +0200 Subject: [PATCH] adding the possibility to get the recent captures --- website/web/genericapi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/web/genericapi.py b/website/web/genericapi.py index 9f453391..02565d74 100644 --- a/website/web/genericapi.py +++ b/website/web/genericapi.py @@ -775,3 +775,10 @@ class CaptureHide(Resource): # type: ignore[misc] except Exception as e: return {'error': f'Unable to hide the tree: {e}'}, 400 return {'info': f'Capture {capture_uuid} successfully hidden.'} + + +@api.route('/json/recent_captures') +@api.doc(description='Get uuids of the most recent captures.') +class RecentCaptures(Resource): # type: ignore[misc] + def get(self): + return lookyloo.redis.zrange('recent_captures',0, -1) \ No newline at end of file