diff options
| author | Scott Ostler <scottostler@gmail.com> | 2012-09-04 21:34:26 -0400 |
|---|---|---|
| committer | Scott Ostler <scottostler@gmail.com> | 2012-09-04 21:34:26 -0400 |
| commit | 5213365b1b2dcdce6f2f61adf0e50861ee1010bc (patch) | |
| tree | 6f9b1041246bab5a8683a5b655da92527743da7f /src | |
| parent | eeb05b5db3e90947d16eaeda5b1e0509c3226218 (diff) | |
Add json-log route
Diffstat (limited to 'src')
| -rw-r--r-- | src/site.clj | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/site.clj b/src/site.clj index 44b0c07..910a76c 100644 --- a/src/site.clj +++ b/src/site.clj @@ -950,6 +950,11 @@ WHERE user_id IN favs (reduce (fn [m fav] (assoc m (str (fav :message_id)) (fav :content))) {} raw-favs)] (str "RawFavs=" (json-str favs)))) +(defn json-log [session params] + (json-str (fetch-dumps-by-nick + :nick (params :nick) + :offset (or (maybe-parse-int (params :offset)) 0)))) + (defn search-query [num-tokens] (str "select url from image_urls @@ -1224,6 +1229,7 @@ WHERE user_id IN (GET "/u/:nick/favorites" (redirect-to (format "/%s/favorites" (params :nick)))) (GET "/u/:nick/favorites/:offset" (redirect-to (format "/%s/favorites" (params :nick)))) (GET "/json/:nick/favorites" (json-favorites session params)) + (GET "/json/:nick/log" (json-log session params)) ; have to put this route after favs (GET "/u/:nick/:offset" (redirect-to (str "/" (params :nick)))) |
