twitter.prettyprint: Add user-profile.
parent
bc7680a914
commit
5ad200a41a
|
@ -1,6 +1,6 @@
|
|||
USING: accessors continuations fry http.client images.loader
|
||||
images.loader.private images.viewer io io.styles kernel memoize
|
||||
prettyprint sequences twitter ;
|
||||
prettyprint sequences twitter assocs ;
|
||||
IN: twitter.prettyprint
|
||||
|
||||
MEMO: load-http-image ( url -- image/f )
|
||||
|
@ -31,6 +31,20 @@ CONSTANT: tweet-metadata-style
|
|||
{ font-size 10 }
|
||||
}
|
||||
|
||||
: profile. ( user -- )
|
||||
tweet-table-style [
|
||||
[
|
||||
[ dup "profile_image_url" of load-http-image image. ] with-cell
|
||||
[
|
||||
tweet-username-style [
|
||||
dup "name" of write nl
|
||||
dup "screen_name" of write
|
||||
] with-style
|
||||
] with-cell
|
||||
] with-row
|
||||
] tabular-output nl
|
||||
drop ;
|
||||
|
||||
: tweet. ( status -- )
|
||||
tweet-table-style [
|
||||
[
|
||||
|
@ -55,6 +69,7 @@ CONSTANT: tweet-metadata-style
|
|||
] tabular-output nl
|
||||
drop ;
|
||||
|
||||
: user-profile. ( user -- ) user-profile profile. ;
|
||||
: friends-timeline. ( -- ) friends-timeline [ tweet. ] each ;
|
||||
: public-timeline. ( -- ) public-timeline [ tweet. ] each ;
|
||||
: user-timeline. ( user -- ) user-timeline [ tweet. ] each ;
|
||||
|
|
Loading…
Reference in New Issue