aboutsummaryrefslogtreecommitdiff
path: root/sx-method.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-03 22:51:45 -0500
committerSean Allred <code@seanallred.com>2015-01-03 22:51:45 -0500
commiteeb327e3af94e1118218c129916b8f7165e835ef (patch)
tree415c2f2f2eda72f72fc8a9fbd1af829283dda556 /sx-method.el
parentd19917d9f152e2eda6b15687dae62f149a3d5779 (diff)
Introduce :page and :pagesize into sx-method-call
Default page size is 100 to reduce number of overall requests made. Fixes #190.
Diffstat (limited to 'sx-method.el')
-rw-r--r--sx-method.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/sx-method.el b/sx-method.el
index 64dbc1f..e0764fb 100644
--- a/sx-method.el
+++ b/sx-method.el
@@ -35,6 +35,8 @@
(cl-defun sx-method-call (method &key id
submethod
keywords
+ page
+ (pagesize 100)
(filter '(()))
auth
(url-method "GET")
@@ -55,6 +57,8 @@ authentication.
:SITE is the api parameter specifying the site.
:GET-ALL is nil or non-nil
:PROCESS-FUNCTION is a response-processing function
+:PAGE is the page number which will be requested
+:PAGESIZE is the number of items to retrieve per request, default 100
When AUTH is nil, it is assumed that no auth-requiring filters or
methods will be used. If they are an error will be signaled. This is
@@ -123,6 +127,8 @@ Return the entire response as a complex alist."
(error "This request requires authentication."))))
;; Concatenate all parameters now that filter is ensured.
(push `(filter . ,(sx-filter-get-var filter)) keywords)
+ (push `(page . ,page) keywords)
+ (push `(pagesize . ,pagesize) keywords)
(when site
(push `(site . ,site) keywords))
(funcall call