clit 0.2.2.3 → 0.2.2.4
raw patch · 3 files changed
+7/−6 lines, 3 filesdep ~basedep ~clitdep ~optparse-applicative
Dependency ranges changed: base, clit, optparse-applicative
Files
- clit.cabal +4/−4
- src/Web/Tweet.hs +2/−2
- src/Web/Tweet/Exec.hs +1/−0
clit.cabal view
@@ -1,5 +1,5 @@ name: clit-version: 0.2.2.3+version: 0.2.2.4 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -31,7 +31,7 @@ authenticate-oauth >=1.5.1.2 && <1.6, bytestring >=0.10.8.1 && <0.11, split >=0.2.3.1 && <0.3,- optparse-applicative >=0.12.1.0 && <0.13.0.0,+ optparse-applicative >=0.12.1.0 && <0.13, lens ==4.14.*, data-default >=0.7.1.1 && <0.8, text >=1.2.2.1 && <1.3@@ -45,8 +45,8 @@ executable tweet main-is: Main.hs build-depends:- base >=4.9.1.0 && <4.10,- clit >=0.2.2.3 && <0.3+ base >=4.9.0.0 && <4.10,+ clit >=0.2.2.4 && <0.3 default-language: Haskell2010 hs-source-dirs: app ghc-options: -threaded -rtsopts -with-rtsopts=-N
src/Web/Tweet.hs view
@@ -69,7 +69,7 @@ thread' content hs idNum num filepath = do let f = \str i -> (flip tweetData filepath) (Tweet { _status = str, _trimUser = True, _handles = hs, _replyID = if i == 0 then Nothing else Just i }) let initial = f (head content)- void $ foldr ((>=>) . f) initial (drop 1 content) $ fromMaybe 0 idNum+ void $ foldr ((>=>) . f) initial (reverse . drop 1 $ content) $ fromMaybe 0 idNum -- | Reply with a single tweet. Works the same as `thread` but doesn't take the fourth argument. --@@ -115,7 +115,7 @@ where trim = _trimUser tweet reply = fromMaybe "" (show <$> _replyID tweet) --- | Percent-ncode the status update so it's fit for a URL+-- | Percent-encode the status update so it's fit for a URL and UTF-encode it as well. tweetEncode :: Tweet -> BS.ByteString tweetEncode tweet = paramEncode . encodeUtf8 $ handleStr `T.append` content where content = T.pack . _status $ tweet
src/Web/Tweet/Exec.hs view
@@ -7,6 +7,7 @@ import qualified Data.ByteString.Char8 as BS import Control.Monad import Data.Foldable (fold)+import Data.Monoid -- | Data type for our program: one optional path to a credential file, (optionally) the number of tweets to make, the id of the status you're replying to, and a list of users you wish to mention. data Program = Program { cred :: Maybe FilePath , tweets :: Maybe Int, replyId :: Maybe String, replyHandles :: Maybe [String] }