aboutsummaryrefslogtreecommitdiff
path: root/cgi/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/api.py')
-rw-r--r--cgi/api.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cgi/api.py b/cgi/api.py
index 871e88f..e6968f8 100644
--- a/cgi/api.py
+++ b/cgi/api.py
@@ -93,18 +93,19 @@ def api_process(self, path_split):
data_limit = formdata.get('limit')
data_time = formdata.get('time', 0)
- limit = 30
-
if data_limit:
try:
limit = int(data_limit)
except ValueError:
raise APIError("Limit must be numeric")
- if limit > 50:
- raise APIError("Maximum limit is 50")
+ if limit > 30:
+ raise APIError("Maximum limit is 30")
+
+ threads = getLastAge(0, limit)
+ threads += getLastAge(1, limit)
+ threads = sorted(threads, key=lambda b:b['bumped'], reverse=True)
- threads = getLastAge(limit)
if threads[0]['bumped'] > int(data_time):
values['threads'] = threads
else: