-- | get authenticated user's last status
getLastStatus :: Token -> IO (Result Status)
getLastStatus tok = do
    -- if last status is official RT, count=1 return empty list
    -- so use count=5
    json <- callAPI GET tok "statuses/user_timeline" [("count", "5"), ("include_entities", "1")]
    -- FIXME: crash when returned empty array
    return $ json >>= readJSON >>= decodeStatus . head


-- | update twitter status
getLastStatus :: Token -> IO (Result Status)
getLastStatus tok = do
    -- if last status is official RT, count=1 return empty list
    -- so use count=5
    json <- callAPI GET tok "statuses/user_timeline" [("count", "5"), ("include_entities", "1")]
    -- FIXME: crash when returned empty array
    return $ json >>= readJSON >>= decodeStatus . head


-- | update twitter status
getLastStatus tok = do
    -- if last status is official RT, count=1 return empty list
    -- so use count=5
    json <- callAPI GET tok "statuses/user_timeline" [("count", "5"), ("include_entities", "1")]
    -- FIXME: crash when returned empty array
    return $ json >>= readJSON >>= decodeStatus . head


-- | update twitter status