Permalink
Browse files

parse and show 'id_str' value

  • Loading branch information...
1 parent 323e282 commit 6ed760abb43fe0af771a2a4adec6744192b712e0 @krdlab committed Jun 16, 2012
Showing with 4 additions and 1 deletion.
  1. +2 −1 hstter.hs
  2. +2 −0 model.hs
View
@@ -64,8 +64,9 @@ success Status {..} = do
Just ctime -> do
tzone <- getCurrentTimeZone
let User {..} = user
- BS.putStrLn $ BS.concat [ "> ", screenName, ": ", name, " (", BC.pack . show $ utcToZonedTime tzone ctime, ")"]
+ BS.putStrLn $ BS.concat ["> ", screenName, ": ", name, " (", BC.pack . show $ utcToZonedTime tzone ctime, ")"]
TI.putStrLn text
+ BS.putStrLn $ BS.concat ["(", idStr, ")"]
BS.putStrLn ""
Nothing -> putStrLn "> time parse error: created_at"
where
View
@@ -12,6 +12,7 @@ data Status = Status
{ text :: Text
, createdAt :: ByteString
, user :: User
+ , idStr :: ByteString
}
deriving (Show, Eq)
@@ -26,6 +27,7 @@ instance FromJSON Status where
<$> v .: "text"
<*> v .: "created_at"
<*> v .: "user"
+ <*> v .: "id_str"
parseJSON _ = mzero
instance FromJSON User where

0 comments on commit 6ed760a

Please sign in to comment.