twitter-feed 0.1.0.0 → 0.1.0.1
raw patch · 2 files changed
+10/−8 lines, 2 files
Files
- src/Web/Twitter/Feed.hs +8/−7
- twitter-feed.cabal +2/−1
src/Web/Twitter/Feed.hs view
@@ -20,7 +20,7 @@ import Control.Applicative import Data.List (sortBy) import Control.Monad (mzero)-import Web.Authenticate.OAuth+import Data.Char (toLower) type BoundingIndices = [Int] @@ -107,10 +107,10 @@ <*> v .:? "media" .!= [] parseJSON _ = mzero -timeline :: String -> OAuth -> Credential -> Int ->+timeline :: OAuth -> Credential -> Int -> Bool -> String -> IO (Either String [SimpleTweet])-timeline twitterUsername oauth credential tweets = do- req <- parseUrl $ timelineUrl twitterUsername tweets+timeline oauth credential count excludeReplies username = do+ req <- parseUrl $ timelineUrl username count excludeReplies res <- withManager $ \m -> do signedreq <- signOAuth oauth credential req httpLbs signedreq m@@ -121,10 +121,11 @@ Nothing -> return $ Left "Unable to retrieve tweets!" Just ts -> return $ Right $ map (simplifyTweet . linkifyTweet) ts -timelineUrl :: String -> Int -> String-timelineUrl user count =+timelineUrl :: String -> Int -> Bool -> String+timelineUrl user count excludeReplies = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" ++- user ++ "&count=" ++ show count+ user ++ "&count=" ++ show count ++ "&exclude_replies=" +++ (map toLower $ show excludeReplies) linkifyTweet :: Tweet -> Tweet linkifyTweet tweet = Tweet (processText (text tweet)
twitter-feed.cabal view
@@ -1,5 +1,5 @@ name: twitter-feed-version: 0.1.0.0+version: 0.1.0.1 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@@ -18,6 +18,7 @@ library exposed-modules: Web.Twitter.Feed+ ghc-options: -threaded -O2 -Wall build-depends: base >=4.6 && <4.7 , json , authenticate-oauth