clit 0.2.3.0 → 0.2.3.1
raw patch · 2 files changed
+12/−4 lines, 2 filesdep ~clit
Dependency ranges changed: clit
Files
- clit.cabal +2/−2
- src/Web/Tweet.hs +10/−2
clit.cabal view
@@ -1,5 +1,5 @@ name: clit-version: 0.2.3.0+version: 0.2.3.1 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -48,7 +48,7 @@ main-is: Main.hs build-depends: base >=4.9.1.0 && <4.10,- clit >=0.2.3.0 && <0.3+ clit >=0.2.3.1 && <0.3 default-language: Haskell2010 hs-source-dirs: app ghc-options: -threaded -rtsopts -with-rtsopts=-N
src/Web/Tweet.hs view
@@ -28,6 +28,7 @@ , signRequest -- * Functions to generate a URL string from a `Tweet` , urlString+ , getTimeline ) where import Network.HTTP.Client@@ -96,12 +97,19 @@ request <- signRequest filepath $ initialRequest { method = "POST" } response request manager -getTimeline :: Int -> FilePath -> IO Response+getTimeline :: Int -> FilePath -> IO () getTimeline count filepath = do let requestString = "?count=" ++ (show count) manager <- newManager tlsManagerSettings initialRequest <- parseRequest ("https://api.twitter.com/1.1/statuses/home_timeline.json" ++ requestString)- response request manager+ request <- signRequest filepath $ initialRequest { method = "GET" }+ responseNull request manager++responseNull :: Request -> Manager -> IO ()+responseNull request manager = do+ response <- httpLbs request manager+ putStrLn $ "The status code was: " ++ show (statusCode $ responseStatus response)+ BSL.putStrLn $ responseBody response -- | print output of a request and return status id as an `Int`. response :: Request -> Manager -> IO Int