twitter-feed 0.2.0.9 → 0.2.0.10
raw patch · 3 files changed
+16/−12 lines, 3 filesdep ~HUnitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: HUnit
API changes (from Hackage documentation)
Files
- src/Web/Twitter/Feed.hs +12/−7
- test/Web/Twitter/Feed/Tests.hs +2/−3
- twitter-feed.cabal +2/−2
src/Web/Twitter/Feed.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, DeriveGeneric #-}+{-# LANGUAGE OverloadedStrings, CPP #-} ----------------------------------------------------------------------------- -- |@@ -20,6 +20,7 @@ import qualified Data.ByteString.Lazy as BS import Network.HTTP.Conduit+import Network.HTTP.Client.Conduit (defaultManagerSettings) import Web.Authenticate.OAuth import Data.Aeson import Data.List (elemIndices, sort)@@ -43,13 +44,17 @@ Right ts -> Right $ map (simplifyTweet . linkifyTweet) ts createRequest :: String -> Int -> Bool -> IO Request-createRequest username count excludeReplies = parseUrl $ timelineUrl username count excludeReplies+createRequest username count excludeReplies = parseUrlThrow $ timelineUrl username count excludeReplies+#if (!MIN_VERSION_http_conduit(2,1,11))+ where+ parseUrlThrow = parseUrl+#endif getResponse :: OAuth -> Credential -> Request -> IO (Response BS.ByteString)-getResponse oauth credential req =- withManager $ \m -> do- signedreq <- signOAuth oauth credential req- httpLbs signedreq m+getResponse oauth credential req = do+ m <- newManager defaultManagerSettings+ signedreq <- signOAuth oauth credential req+ httpLbs signedreq m decodeTweets :: Response BS.ByteString -> Either String [Tweet] decodeTweets = eitherDecode . responseBody@@ -62,7 +67,7 @@ timelineUrl user count excludeReplies = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" ++ user ++ "&count=" ++ show count ++ "&exclude_replies=" ++- (map toLower $ show excludeReplies)+ map toLower (show excludeReplies) linkifyTweet :: Tweet -> Tweet linkifyTweet tweet = Tweet (processText (text tweet)
test/Web/Twitter/Feed/Tests.hs view
@@ -19,9 +19,8 @@ timelineUrlTest :: Assertion timelineUrlTest = timelineUrl "someone" 3 True @?= expected where- expected = concat [ "https://api.twitter.com/1.1/statuses/user_timeline.json"- , "?screen_name=someone&count=3&exclude_replies=true"- ]+ expected = "https://api.twitter.com/1.1/statuses/user_timeline.json" +++ "?screen_name=someone&count=3&exclude_replies=true" sortLinkTest :: Assertion sortLinkTest =
twitter-feed.cabal view
@@ -1,5 +1,5 @@ name: twitter-feed-version: 0.2.0.9+version: 0.2.0.10 synopsis: Client for fetching Twitter timeline via Oauth description: Fetches a user timeline from Twitter, and optionally linkifies the results using the Twitter entity API. homepage: https://github.com/stackbuilders/twitter-feed@@ -39,7 +39,7 @@ base, twitter-feed, containers >= 0.5 && < 0.6,- HUnit >= 1.2 && < 1.4,+ HUnit >= 1.2 && < 1.5, test-framework >= 0.8 && < 0.9, test-framework-hunit >= 0.3 && < 0.4