 PRIVATE>
 
 : subreddit-top ( subreddit -- )
-    (subreddit) data>> [
+    get-subreddit data>> [
         1 + "%2d. " sprintf write-text {
-            [ title>> write-title nl ]
-            [ "    " write url>> write-url ]
-            [ score>> ]
-            [ num_comments>> ]
+            [ [ title>> ] [ url>> ] bi write-title nl ]
+            [ score>> "    %d points, " sprintf write-text ]
+            [ [ num_comments>> "%d comments" sprintf ] [ story>comments-url ] bi write-link ]
             [
                 created_utc>> unix-time>timestamp now swap time-
-                duration>hours "%d hours ago" sprintf
+                duration>hours ", posted %d hours ago" sprintf write-text
             ]
-            [ author>> ]
+            [ " by " write-text [ author>> ] [ story>author-url ] bi write-link nl nl ]
         } cleave
-        "    %d points, %d comments, posted %s by %s\n\n"
-        sprintf write-text
     ] each-index ;
 
 : domain-stats ( domain -- stats )

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

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

<PRIVATE

: write-title ( str -- )
    H{ { foreground COLOR: blue } } format ;

: write-text ( str -- )
    H{ { foreground HEXCOLOR: 888888 } } format ;


PRIVATE>

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

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

