diff --git a/extra/twitter/prettyprint/prettyprint.factor b/extra/twitter/prettyprint/prettyprint.factor index 21b2426339..26f9f89eb7 100644 --- a/extra/twitter/prettyprint/prettyprint.factor +++ b/extra/twitter/prettyprint/prettyprint.factor @@ -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 ;