Created
          March 26, 2012 17:14 
        
      - 
      
 - 
        
Save anonymous/2206573 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -- タイムラインを表示 | |
| 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