From a2c113c6ac0fc7808421e61e88e7b81ea0975c60 Mon Sep 17 00:00:00 2001 From: Brian Jing Date: Mon, 22 Nov 2021 23:38:44 +1100 Subject: [PATCH 1/3] Fix outdated conduit usages in documentation --- Web/Twitter/Conduit.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Web/Twitter/Conduit.hs b/Web/Twitter/Conduit.hs index 2ebd06a..f242600 100644 --- a/Web/Twitter/Conduit.hs +++ b/Web/Twitter/Conduit.hs @@ -175,12 +175,16 @@ import qualified Data.Text.IO as T -- main = do -- mgr \<- 'newManager' 'tlsManagerSettings' -- 'sourceWithMaxId' twInfo mgr 'homeTimeline' --- $= CL.isolate 60 --- $$ CL.mapM_ $ \\status -> liftIO $ do --- T.putStrLn $ T.concat [ T.pack . show $ status ^. statusId --- , \": \" --- , status ^. statusUser . userScreenName --- , \": \" --- , status ^. statusText --- ] +-- .| CL.isolate 60 +-- .| CL.mapM_ $ +-- (\\status -> liftIO $ do +-- T.putStrLn $ +-- T.concat +-- [ T.pack . show $ status ^. statusId +-- , \": \" +-- , status ^. statusUser . userScreenName +-- , \": \" +-- , status ^. statusText +-- ] +-- ) -- @ From 49e22fb97d113ac86c7eb277dd00fe9d43dccf1d Mon Sep 17 00:00:00 2001 From: Brian Jing Date: Mon, 22 Nov 2021 23:53:33 +1100 Subject: [PATCH 2/3] Fix comment inconsistency and more code example --- Web/Twitter/Conduit.hs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Web/Twitter/Conduit.hs b/Web/Twitter/Conduit.hs index f242600..a6f93a2 100644 --- a/Web/Twitter/Conduit.hs +++ b/Web/Twitter/Conduit.hs @@ -163,12 +163,12 @@ import qualified Data.Text.IO as T -- or use the conduit wrapper 'sourceWithCursor' as below: -- -- @ --- friends \<- 'sourceWithCursor' twInfo mgr ('friendsList' ('ScreenNameParam' \"thimura\") '&' #count '?~' 200) '$$' 'CL.consume' +-- friends \<- 'sourceWithCursor' twInfo mgr ('friendsList' ('ScreenNameParam' \"thimura\") '&' #count '?~' 200) '.|' 'CL.consume' -- @ -- -- Statuses APIs, for instance, 'homeTimeline', are also wrapped by 'sourceWithMaxId'. -- --- For example, you can print 1000 tweets from your home timeline, as below: +-- For example, you can print 60 tweets from your home timeline, as below: -- -- @ -- main :: IO () @@ -176,15 +176,15 @@ import qualified Data.Text.IO as T -- mgr \<- 'newManager' 'tlsManagerSettings' -- 'sourceWithMaxId' twInfo mgr 'homeTimeline' -- .| CL.isolate 60 --- .| CL.mapM_ $ --- (\\status -> liftIO $ do --- T.putStrLn $ --- T.concat --- [ T.pack . show $ status ^. statusId --- , \": \" --- , status ^. statusUser . userScreenName --- , \": \" --- , status ^. statusText --- ] +-- .| CL.mapM_ +-- (\\status -> do +-- T.putStrLn $ +-- T.concat +-- [ T.pack . show $ status ^. statusId +-- , \": \" +-- , status ^. statusUser . userScreenName +-- , \": \" +-- , status ^. statusText +-- ] -- ) -- @ From 9a1399bae871730178c8e10aa3d9b7efb5ba5528 Mon Sep 17 00:00:00 2001 From: Brian Jing Date: Tue, 23 Nov 2021 17:10:39 +1100 Subject: [PATCH 3/3] Add missing runConduit function --- Web/Twitter/Conduit.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Twitter/Conduit.hs b/Web/Twitter/Conduit.hs index a6f93a2..ba48ec3 100644 --- a/Web/Twitter/Conduit.hs +++ b/Web/Twitter/Conduit.hs @@ -174,7 +174,7 @@ import qualified Data.Text.IO as T -- main :: IO () -- main = do -- mgr \<- 'newManager' 'tlsManagerSettings' --- 'sourceWithMaxId' twInfo mgr 'homeTimeline' +-- runConduit $ 'sourceWithMaxId' twInfo mgr 'homeTimeline' -- .| CL.isolate 60 -- .| CL.mapM_ -- (\\status -> do