From 3a4af37c6fd4efee44a6189ae93608f671c80f82 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 30 Oct 2014 22:40:20 -0400 Subject: Implement question list retrieval --- stack-question.el | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'stack-question.el') 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 -- cgit v1.2.3