         [ "after" swap at [ f ] when-json-null ]
     } cleave \ page boa ;
 
-: (user) ( username -- data )
+: get-user ( username -- page )
     "http://api.reddit.com/user/%s" sprintf json-page ;
 
-: (about) ( username -- data )
+: get-user-info ( username -- user )
     "http://api.reddit.com/user/%s/about" sprintf
     http-get nip json> parse-data ;
 
-: (url) ( url -- data )
+: get-url-info ( url -- page )
     "http://api.reddit.com/api/info?url=%s" sprintf json-page ;
 
-: (search) ( query -- data )
+: search-reddit ( query -- page )
     "http://api.reddit.com/search?q=%s" sprintf json-page ;
 
-: (subreddits) ( query -- data )
+: search-subreddits ( query -- page )
     "http://api.reddit.com/reddits/search?q=%s" sprintf json-page ;
 
-: (domains) ( query -- data )
+: get-domains ( query -- page )
     "http://api.reddit.com/domain/%s" sprintf json-page ;
+
+: get-subreddit ( subreddit -- page )
+    "http://api.reddit.com/r/%s" sprintf json-page ;
 
 : next-page ( page -- page' )
     [ url>> ] [ after>> "after" set-query-param ] bi json-page ;


PRIVATE>

: get-subreddit ( subreddit -- data )
    "http://api.reddit.com/r/%s" sprintf json-page ;

: user-links ( username -- stories )
    (user) data>> [ story? ] filter [ url>> ] map ;

: user-comments ( username -- comments )
    (user) data>> [ comment? ] filter [ body>> ] map ;

: user-karma ( username -- karma )
    (about) link_karma>> ;

: url-score ( url -- score )
    (url) data>> [ score>> ] map-sum ;

: subreddit-links ( subreddit -- links )
    get-subreddit data>> [ url>> ] map ;

    ] each-index ;

: domain-stats ( domain -- stats )
    get-domains all-pages [
        created>> 1000 * millis>timestamp year>>
    ] collect-by [ [ score>> ] map-sum ] assoc-map ;
