aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/api.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cgi/api.py b/cgi/api.py
index ce1e467..19122d0 100644
--- a/cgi/api.py
+++ b/cgi/api.py
@@ -371,6 +371,20 @@ def api_process(self, path_split):
values['post_url'] = post_url
values['time_taken'] = ttaken
+ elif method == 'newThreads':
+ data_limit = formdata.get('limit')
+ limit = 30
+ if data_limit:
+ try:
+ limit = int(data_limit)
+ except ValueError:
+ raise APIError, "Limit must be numeric"
+
+ if limit > 30:
+ raise APIError, "Maximum limit is 30"
+
+ threads = getNewThreads(limit)
+ values['threads'] = threads
else:
raise APIError, "Invalid method"