Skip to content

Commit

Permalink
Wipe redundant code (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
himura committed Feb 8, 2015
1 parent 8a00065 commit a594e6b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sample/userstream.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE PatternGuards #-}

import Web.Twitter.Conduit
Expand Down Expand Up @@ -37,7 +36,7 @@ main = do
twInfo <- getTWInfoFromEnv
withManager $ \mgr -> do
src <- stream twInfo mgr userstream
src C.$$+- CL.mapM_ (^! act (liftIO . printTL))
src C.$$+- CL.mapM_ (liftIO . printTL)

showStatus :: AsStatus s => s -> T.Text
showStatus s = T.concat [ s ^. user . userScreenName
Expand All @@ -53,7 +52,7 @@ printTL (SRetweetedStatus s) = T.putStrLn $ T.concat [ s ^. user . userScreenNam
]
printTL (SEvent event)
| (event^.evEvent) == "favorite" || (event^.evEvent) == "unfavorite",
Just (ETStatus st) <- (event ^. evTargetObject) = do
Just (ETStatus st) <- event ^. evTargetObject = do
let (fromUser, fromIcon) = evUserInfo (event^.evSource)
(toUser, _toIcon) = evUserInfo (event^.evTarget)
evUserInfo (ETUser u) = (u ^. userScreenName, u ^. userProfileImageURL)
Expand Down

0 comments on commit a594e6b

Please sign in to comment.