! Copyright (C) 2012 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs classes.tuple colors.constants
-colors.hex combinators concurrency.combinators formatting fry
-hashtables http.client io io.styles json json.reader kernel make
-math math.parser sequences splitting ui urls ;
+
+USING: accessors assocs calendar calendar.elapsed
+colors.constants colors.hex combinators concurrency.combinators
+formatting fry hashtables http.client io io.styles json.reader
+kernel make math math.parser sequences ui urls ;
+
IN: hacker-news
<PRIVATE
[ post>url host>> " (" ")" surround write-text nl ]
[ "score" of " %d points" sprintf write-text ]
[ dup "by" of [ " by " write-text [ "by" of ] [ post>user-url ] bi write-link ] [ drop ] if ]
- ! [ dup postedAgo>> [ " " write-text postedAgo>> write-text ] [ drop ] if ]
+ [
+ "time" of [
+ " " write-text now timestamp>unix-time
+ swap - relative-time write-text
+ ] when*
+ ]
[
dup "decendants" of [
" | " write-text