From 4d98dc944c17961b2c1f9bf0a92274700d20ccb4 Mon Sep 17 00:00:00 2001 From: Carlos Sosa Date: Thu, 1 Aug 2019 00:09:54 -0700 Subject: Add logic to erase follower that already exists as a list member --- app/diff-lists-contacts/Main.hs | 9 +++++++-- package.yaml | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/diff-lists-contacts/Main.hs b/app/diff-lists-contacts/Main.hs index 671100c..523de3e 100644 --- a/app/diff-lists-contacts/Main.hs +++ b/app/diff-lists-contacts/Main.hs @@ -32,13 +32,18 @@ main = do mgr <- newManager tlsManagerSettings putStrLn $ "# your home timeline (up to 200 tweets):" listMembers <- runConduit $ - sourceWithMaxId twInfo mgr (listMembers (ListNameParam "user/someList")) + sourceWithCursor twInfo mgr (listsMembers (ListNameParam "user/someList")) .| (CL.isolate 200) .| (mapC (\user -> do user ^. userId)) + .| (mapC UserIdParam) + .| (mapC friendshipsDestroy) + .| (mapC (\req -> do + callWithResponse twInfo mgr req)) .| sinkList - mapM_ (putStrLn . show) listMembers + resp <- sequence listMembers + mapM_ (putStrLn . show) resp diff --git a/package.yaml b/package.yaml index 9c3e120..8bab728 100644 --- a/package.yaml +++ b/package.yaml @@ -33,9 +33,18 @@ library: source-dirs: src executables: - twitter-tools-exe: + diff-lists-contacts: main: Main.hs - source-dirs: app + source-dirs: app/diff-lists-contacts + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - twitter-tools + timeline-delete: + main: Main.hs + source-dirs: app/timeline-delete ghc-options: - -threaded - -rtsopts -- cgit v1.3-2-g0d8e