summaryrefslogtreecommitdiff
path: root/src/site.clj
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2010-10-03 21:28:23 -0400
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2010-10-03 21:28:23 -0400
commit02a0597e39ed337ba4dc0cccddebb4c98c63b5ee (patch)
tree9606f75c4d24702310945dc0bd0affa885a11f8c /src/site.clj
parente5f01c9ad63b4547900a488c452523a3f88344c5 (diff)
timb: better hiscore code
Diffstat (limited to 'src/site.clj')
-rw-r--r--src/site.clj7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/site.clj b/src/site.clj
index c9b484b..98fde79 100644
--- a/src/site.clj
+++ b/src/site.clj
@@ -853,7 +853,7 @@ WHERE u.user_id = ANY(?)"
(defn redis-ids-test [period]
(let [reddis-server {:host "127.0.0.1" :port 6379 :db 0}
ids (redis/with-server reddis-server
- (redis/zrevrange (str "hiscore." period) 0 20))
+ (redis/zrevrange (str "hiscore:" period) 0 -1))
ids (map maybe-parse-int ids)]
ids))
@@ -872,6 +872,9 @@ WHERE u.user_id = ANY(?)"
;; Altars
+;; if :nick is in params, will fetch only altars by that nick
+;; next page links look like /altars/message-id and select <= message_id order desc
+;; prev page links look like /altars/-message-id and select > message_id order asc
(defn altar-log [session params]
(let [id (params :id)
nick (params :nick)
@@ -1328,6 +1331,8 @@ WHERE u.user_id = ANY(?)"
;; testing
(GET "/test/hiscores" (hiscore-test session params "week"))
+ (GET "/test/hiscores/alltime" (hiscore-test session params "all"))
+ (GET "/test/hiscores/day" (hiscore-test session params "day"))
(GET "/test/hiscores/week" (hiscore-test session params "week"))
(GET "/test/hiscores/month" (hiscore-test session params "month"))