module Web.Tweet.API.Internal where
import Data.Void
import Text.Megaparsec.Error
import Web.Tweet.API
import Web.Tweet.Types
import Web.Tweet.Utils
showProfile :: String -> Int -> Bool -> FilePath -> IO String
showProfile screenName count color = fmap (showTweets color) . getProfile screenName count
showBest :: String -> Int -> Bool -> FilePath -> IO String
showBest screenName n color = fmap (showTweets color . pure . (take n . hits)) . getAll screenName Nothing
showBest' :: String -> Int -> Bool -> FilePath -> IO String
showBest' screenName n color = fmap (showTweets color . pure . (take n . hits')) . getAll screenName Nothing
showTimeline :: Int -> Bool -> FilePath -> IO String
showTimeline count color = (fmap (showTweets color)) . getTimeline count
showTweets :: Bool -> Either (ParseError Char Void) Timeline -> String
showTweets color = (either show id) . (fmap (if color then displayTimelineColor else displayTimeline))