aboutsummaryrefslogtreecommitdiff
path: root/stack-core.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-05 19:55:24 -0500
committerSean Allred <code@seanallred.com>2014-11-05 19:55:24 -0500
commit9cb376361983742f0a15775b233fc194d61b3ea7 (patch)
tree13753e756b3746c6880b3aa286b68c727ada89aa /stack-core.el
parent1a780c0d887ec3933a0c9192a0b3c045be855a66 (diff)
Add API key to requests
Diffstat (limited to 'stack-core.el')
-rw-r--r--stack-core.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/stack-core.el b/stack-core.el
index c78c316..197a7e4 100644
--- a/stack-core.el
+++ b/stack-core.el
@@ -57,6 +57,10 @@
(format "http://api.stackexchange.com/%s/" stack-core-api-version)
"The base URL to make requests from.")
+(defconst stack-core-api-key
+ "0TE6s1tveCpP9K5r5JNDNQ(("
+ "When passed, this key provides a higher request quota.")
+
(defcustom stack-core-default-keyword-arguments-alist
'(("filters/create")
("sites")
@@ -164,8 +168,9 @@ entire response as a complex alist."
(call
(stack-core-build-request
method
- (cons `(filter . ,(cond (filter filter)
- ((boundp 'stack-filter) stack-filter)))
+ (append `((filter . ,(cond (filter filter)
+ ((boundp 'stack-filter) stack-filter)))
+ (key . ,stack-core-api-key))
(if keyword-arguments keyword-arguments
(stack-core-get-default-keyword-arguments method))))))
;; TODO: url-retrieve-synchronously can return nil if the call is