diff options
author | Sean Allred <code@seanallred.com> | 2014-10-30 22:40:20 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-10-30 22:40:20 -0400 |
commit | 3a4af37c6fd4efee44a6189ae93608f671c80f82 (patch) | |
tree | 412bd8f59bb207e3a8e9aa25f7979a5060acd3f6 /stack-question.el | |
parent | bc483a2a41c69214a26c4d6d3eb073d9870168c5 (diff) |
Implement question list retrieval
Diffstat (limited to 'stack-question.el')
-rw-r--r-- | stack-question.el | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/stack-question.el b/stack-question.el index 83247d8..13cc5e8 100644 --- a/stack-question.el +++ b/stack-question.el @@ -24,15 +24,21 @@ ;;; Code: -(if (boundp 'production) - (require 'stack-core) - (setq load-path (cons "." load-path)) - (load "stack-core.el")) - -(defun stack-question-parse (data) - "Parse and return the questions from DATA as returned by -`stack-core-make-request'" - (cdr (assoc 'items data))) +(require 'stack-core) +(require 'stack-filter) + +(defvar stack-question-browse-filter + (stack-filter-compile nil + '(user.profile_image shallow_user.profile_image))) + +(defun stack-question-get-questions (site &optional page) + "Get the page PAGE of questions from SITE." + (cdr (assoc 'items + (stack-core-make-request + "questions" + `((site . ,site) + (page . ,page)) + stack-question-browse-filter)))) (provide 'stack-question) ;;; stack-question.el ends here |