title: $:/plugins/tiddlywiki/twitter-archivist/macros tags: $:/tags/Macro \define skinny-tabs(tabNames,tabCaptions,defaultTab,state) <$let currTab={{{ [<__state__>get[text]else<__defaultTab__>] }}} >
<$list filter="[enlist<__tabNames__>]" variable="tab" counter="tabCounter"> <$let caption={{{ [enlist<__tabCaptions__>nth] }}} > <$list filter="[match]" variable="ignore"> <$button aria-checked="true" class="tc-tab-selected" role="switch"> <$action-setfield $tiddler=<<__state__>> $value=<>/> <$text text=<>/> <$list filter="[!match]" variable="ignore"> <$button role="switch"> <$action-setfield $tiddler=<<__state__>> $value=<>/> <$text text=<>/>
<$list filter="[enlist<__tabNames__>]" variable="tab" counter="tabCounter"> <$list filter="[match]" variable="ignore">
<$macrocall $name=<>/>
<$list filter="[!match]" variable="ignore">
\end \define list-archives() \whitespace trim <$list filter="[tag[$:/tags/TwitterArchive]limit[1]]" emptyMessage=<> variable="ignore"> \end \define list-archives-empty()

No Twitter Archives are currently loaded

<$transclude tiddler="$:/plugins/tiddlywiki/twitter-archivist/usage" mode="block"/> \end \define show-archive() <$let user_id={{!!user_id}} >
<> <> <> <> <> <count[]]">> <] :reduce[get[favorite_count]else[0]add]">> <] :reduce[get[retweet_count]else[0]add]">> <> <> <> <>
<$macrocall $name="skinny-tabs" tabNames="show-archive-tweets show-favorited-tweets" tabCaptions="Tweets Favourites" defaultTab="show-archive-tweets" state=<>/>
\end \define show-archive-tweets() <$let user_id={{!!user_id}}> <$list filter="[tag[$:/tags/Tweet]field:user_id!sort[created]limit[50]]"> <> \end \define show-favorited-tweets() <$let user_id={{!!user_id}}> <$list filter="[tag[$:/tags/Tweet]field:liked_bylimit[50]]"> <> \end \define show-archive-attribute(caption,field,prefix,format:"text",template) <$text text=<<__caption__>>/> <$text text={{{ [<__prefix__>] }}}/> <$view field=<<__field__>> format=<<__format__>> template=<<__template__>>/> \end \define show-archive-calculated-attribute(caption,filter) <$text text=<<__caption__>>/> <$text text={{{ [subfilter<__filter__>] }}}/> \end \define show-tweet() \end \define show-tweet-thread(archive) \end \define show-tweeter()
Username<$text text={{!!screenname}}/>
Display Name<$text text={{!!name}}/>
User ID<$text text={{!!user_id}}/>
View on Twitter <$macrocall $name="skinny-tabs" tabNames="show-tweeter-mentions" tabCaptions="Mentions" defaultTab="show-tweeter-mentions" state=<>/> \end \define show-tweeter-mentions() <$list filter="[tag[$:/tags/Tweet]tag]"> <$macrocall $name="show-tweet" archive=<> title=<>/> \end