aboutsummaryrefslogtreecommitdiff
path: root/sx-question.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-21 20:26:43 -0600
committerSean Allred <code@seanallred.com>2014-11-21 20:26:43 -0600
commit3edd697b1d34a05e3112eb61ff82f71f79aafa6d (patch)
tree3717181f3210f8894bba8eeabbec9db66719eb48 /sx-question.el
parent88d040226513025b14ed76dd0819611bfb0a8fd4 (diff)
parent06cd4215de8d2e8680de74546984d9bdbc47b1d3 (diff)
Merge pull request #84 from jleechpe/sx-method-auth
Implement checking for filter and method authentication requirement.
Diffstat (limited to 'sx-question.el')
-rw-r--r--sx-question.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/sx-question.el b/sx-question.el
index f6b7beb..c66d253 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -33,6 +33,8 @@
question.last_editor
question.accepted_answer_id
question.link
+ question.upvoted
+ question.downvoted
user.display_name
comment.owner
comment.body_markdown
@@ -55,19 +57,20 @@ property.
`sx-method-call' is used with `sx-question-browse-filter'."
(mapcar
(lambda (question) (cons (cons 'site site) question))
- (sx-method-call
- "questions"
- `((site . ,site)
- (page . ,page))
- sx-question-browse-filter)))
+ (sx-method-call 'questions
+ :keywords `((page . ,page))
+ :site site
+ :auth t
+ :filter sx-question-browse-filter)))
(defun sx-question-get-question (site question-id)
"Query SITE for a QUESTION-ID and return it.
If QUESTION-ID doesn't exist on SITE, raise an error."
- (let ((res (sx-method-call
- (format "questions/%s" question-id)
- `((site . ,site))
- sx-question-browse-filter)))
+ (let ((res (sx-method-call 'questions
+ :id id
+ :site site
+ :auth t
+ :filter sx-question-browse-filter)))
(if (vectorp res)
(elt res 0)
(error "Couldn't find question %S in %S"