Skip to content

Instantly share code, notes, and snippets.

Created March 26, 2012 17:14
Show Gist options
  • Save anonymous/2206573 to your computer and use it in GitHub Desktop.
Save anonymous/2206573 to your computer and use it in GitHub Desktop.
-- タイムラインを表示
showTimeline :: GUI -> OAuth -> IO Bool
showTimeline gui oauth = do
-- タイムラインから最新のツイートを取得
newestTweet <- apiRequest oauth "home_timeline" GET []
res <- simpleHTTPIO newestTweet
let tryJSON = case decode (rspBody res) of
Ok a -> a
Error _ -> JSNull
tweets <- (getTimeline tryJSON)
-- text buffer生成
buffer <- textViewGetBuffer (timeline gui)
let tl = foldl (\s -> \t -> s ++ (show t) ++ "\n") "" tweets
textBufferSetText buffer tl
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment