tweet-hs 0.5.3.0 → 0.5.3.2
raw patch · 4 files changed
+39/−9 lines, 4 filesdep ~tweet-hs
Dependency ranges changed: tweet-hs
Files
- src/Web/Tweet/API.hs +1/−1
- src/Web/Tweet/Utils.hs +30/−4
- src/Web/Tweet/Utils/Colors.hs +4/−0
- tweet-hs.cabal +4/−4
src/Web/Tweet/API.hs view
@@ -56,7 +56,7 @@ -- | Gets mentions mentionsRaw :: Int -> FilePath -> IO BSL.ByteString-mentionsRaw count filepath = getRequest ("https://api.twitter.com/1.1/statuses/user_timeline.json" ++ requestString) filepath+mentionsRaw count filepath = getRequest ("https://api.twitter.com/1.1/statuses/mentions_timeline.json" ++ requestString) filepath where requestString = "?count=" ++ (show count) -- | Get user profile given screen name and how many tweets to return
src/Web/Tweet/Utils.hs view
@@ -32,7 +32,10 @@ -- | Display Timeline without color displayTimeline :: Timeline -> String-displayTimeline ((TweetEntity content user _ _ Nothing rts fave):rest) = concat [user+displayTimeline ((TweetEntity content user screenName idTweet Nothing rts fave):rest) = concat [user+ , " ("+ , screenName+ , ")" ,":\n " ,fixNewline content ,"\n " @@ -40,9 +43,14 @@ ,show fave ," ♺ " ,show rts + , " "+ , show idTweet ,"\n\n" ,displayTimeline rest]-displayTimeline ((TweetEntity content user _ _ (Just quoted) rts fave):rest) = concat [user +displayTimeline ((TweetEntity content user screenName idTweet (Just quoted) rts fave):rest) = concat [user + , " ("+ , screenName+ , ")" , ":\n " , fixNewline content , "\n " @@ -50,8 +58,13 @@ , show fave , " ♺ " , show rts + , " "+ , show idTweet , "\n " , _name quoted + , " ("+ , _screenName quoted+ , ")" , ": " , _text quoted , "\n\n" @@ -60,7 +73,10 @@ -- | Display Timeline in color displayTimelineColor :: Timeline -> String-displayTimelineColor ((TweetEntity content user _ _ Nothing rts fave):rest) = concat [toYellow user +displayTimelineColor ((TweetEntity content user screenName idTweet Nothing rts fave):rest) = concat [toYellow user + , " ("+ , screenName+ , ")" , ":\n " , fixNewline content , "\n " @@ -68,9 +84,14 @@ , show fave , toGreen " ♺ " , show rts + , " "+ , toBlue (show idTweet) , "\n\n" , displayTimelineColor rest]-displayTimelineColor ((TweetEntity content user _ _ (Just quoted) rts fave):rest) = concat [toYellow user +displayTimelineColor ((TweetEntity content user screenName idTweet (Just quoted) rts fave):rest) = concat [toYellow user + , " ("+ , screenName+ , ")" , ":\n " , fixNewline content , "\n " @@ -78,8 +99,13 @@ , show fave , toGreen " ♺ " , show rts + , " "+ , toBlue (show idTweet) , "\n " , toYellow $ _name quoted + , " ("+ , _screenName quoted+ , ")" , ": " , _text quoted , "\n\n"
src/Web/Tweet/Utils/Colors.hs view
@@ -14,3 +14,7 @@ -- | Make a string green toGreen :: String -> String toGreen = show . dullgreen . text++-- | Make a string blue+toBlue :: String -> String+toBlue = show . underline . dullblue . text
tweet-hs.cabal view
@@ -1,5 +1,5 @@ name: tweet-hs-version: 0.5.3.0+version: 0.5.3.2 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -70,7 +70,7 @@ main-is: Main.hs build-depends: base >=4.9.1.0 && <4.10,- tweet-hs >=0.5.3.0 && <0.6+ tweet-hs >=0.5.3.2 && <0.6 default-language: Haskell2010 hs-source-dirs: app @@ -79,7 +79,7 @@ main-is: Spec.hs build-depends: base >=4.9.1.0 && <4.10,- tweet-hs >=0.5.3.0 && <0.6,+ tweet-hs >=0.5.3.2 && <0.6, hspec >=2.4.2 && <2.5, hspec-megaparsec >=0.3.1 && <0.4, megaparsec >=5.2.0 && <5.3,@@ -99,7 +99,7 @@ build-depends: base >=4.9.1.0 && <4.10, criterion >=1.1.4.0 && <1.2,- tweet-hs >=0.5.3.0 && <0.6,+ tweet-hs >=0.5.3.2 && <0.6, megaparsec >=5.2.0 && <5.3, bytestring >=0.10.8.1 && <0.11 default-language: Haskell2010