aboutsummaryrefslogtreecommitdiff
path: root/sx-question.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2015-01-15 00:22:51 -0500
committerSean Allred <code@seanallred.com>2015-01-15 00:22:51 -0500
commit087ff1fdf3c4d42510d59a91659f166763baec57 (patch)
treefb3daec223f02ce3ce359da8ba84c59c2750f76c /sx-question.el
parentfe912f7a4871f7beedeafe5f29feb57ca65ecc47 (diff)
Add more sorting functions
Diffstat (limited to 'sx-question.el')
-rw-r--r--sx-question.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/sx-question.el b/sx-question.el
index d624f45..7c687e8 100644
--- a/sx-question.el
+++ b/sx-question.el
@@ -194,6 +194,14 @@ If no cache exists for it, initialize one with SITE."
"Return t if answer A has a higher score than answer B."
#'> (lambda (x) (cdr (assoc 'score x))))
+(sx--create-comparator sx-answer-older-p
+ "Return t if answer A was posted later than answer B."
+ #'< (lambda (x) (cdr (assoc 'creation_date x))))
+
+(sx--create-comparator sx-answer-more-active-p
+ "Return t if answer A was updated after answer B."
+ #'> (lambda (x) (cdr (assoc 'last_activity_date x))))
+
(provide 'sx-question)
;;; sx-question.el ends here