rss2irc 1.0.5 → 1.0.6
raw patch · 7 files changed
+21/−15 lines, 7 filesdep +http-clientdep ~feeddep ~http-conduit
Dependencies added: http-client
Dependency ranges changed: feed, http-conduit
Files
- Base.hs +1/−1
- CHANGES +4/−0
- Feed.hs +6/−6
- Irc.hs +1/−1
- Utils.hs +1/−1
- rss2irc.cabal +4/−3
- rss2irc.hs +4/−3
Base.hs view
@@ -3,7 +3,7 @@ Types and settings. -Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2011+Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2014 License: BSD3. -}
CHANGES view
@@ -1,3 +1,7 @@+1.0.6 (2014/4/13)++* minimal changes to build with feed 0.3.9.* and other libs in current Debian unstable (sid)+ 1.0.5 (2014/2/27) * avoid feed 0.3.9.2 which has changed its API
Feed.hs view
@@ -3,7 +3,7 @@ Feed stuff. -Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2011+Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2014 License: BSD3. -}@@ -40,7 +40,7 @@ (==) a b = let match f = f a == f b in all match [getItemTitle ,getItemLink- ,getItemPublishDate+ ,getItemPublishDateString ,getItemDate ,getItemAuthor ,getItemCommentLink@@ -96,7 +96,7 @@ when (debug_feed opts) $ logPoll fetched announceable polls numannounced -- start iterating let seen = map (\i -> (itemId i, fromMaybe "" $ getItemTitle i)) fetched- lastpubdate = maybe Nothing getItemPublishDate $ headMay unique+ lastpubdate = maybe Nothing getItemPublishDateString $ headMay unique putSharedVar appvar $ maybeDecrementIterationsLeft app feedReaderPoll appvar polls seen lastpubdate numannounced @@ -113,7 +113,7 @@ -- detect announceable items let seenids = map fst seen hasunseenid = (`notElem` seenids).itemId- hasnewerdate = (`isNewerThan` lastpubdate).getItemPublishDate+ hasnewerdate = (`isNewerThan` lastpubdate).getItemPublishDateString isunseenandnewer i = hasnewerdate i && hasunseenid i isprevioustop = (== head seenids).itemId announceable = (if allow_duplicates opts then id else (elideDuplicates seen)) $@@ -126,7 +126,7 @@ let polls' = polls + 1 seen' = take windowsize $ (map (\i -> (itemId i, fromMaybe "" $ getItemTitle i)) fetched) ++ seen where windowsize = 200- lastpubdate' = maybe lastpubdate getItemPublishDate $ headMay announceable+ lastpubdate' = maybe lastpubdate getItemPublishDateString $ headMay announceable numannounced' = numannounced + fromIntegral (length announceable) putSharedVar appvar $ maybeDecrementIterationsLeft app when (debug_feed opts) $ logPoll fetched announceable polls' numannounced'@@ -259,7 +259,7 @@ count = length is fields = [(d, if p==d then "" :: String else printf " pubdate:%-29s" p, t, i) | item <- is ,let d = fromMaybe "" $ getItemDate item- ,let p = fromMaybe "" $ getItemPublishDate item+ ,let p = fromMaybe "" $ getItemPublishDateString item ,let t = fromMaybe "" $ getItemTitle item ,let i = maybe "" show $ getItemId item ]
Irc.hs view
@@ -3,7 +3,7 @@ IRC stuff -Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2011+Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2014 License: BSD3. -}
Utils.hs view
@@ -3,7 +3,7 @@ Common utilities. -Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2011+Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2014 License: BSD3. -}
rss2irc.cabal view
@@ -1,5 +1,5 @@ name: rss2irc-version: 1.0.5+version: 1.0.6 homepage: http://hackage.haskell.org/package/rss2irc license: BSD3 license-file: LICENSE@@ -35,8 +35,9 @@ ,containers ,deepseq ,irc >= 0.5 && < 0.6- ,feed >= 0.3.8 && < 0.3.9.2- ,http-conduit >= 1.9 && < 2.0+ ,feed >= 0.3.9 && < 0.3.10+ ,http-client >= 0.2.1 && < 0.2.3+ ,http-conduit >= 1.9 && < 2.1 ,resourcet >= 0.4.4 && < 0.5 ,http-types >= 0.6.4 && < 0.9 ,io-storage >= 0.3 && < 0.4
rss2irc.hs view
@@ -4,7 +4,7 @@ {- | rss2irc - watches an RSS/Atom feed and writes it to an IRC channel. -Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2011+Copyright (c) Don Stewart 2008-2009, Simon Michael 2009-2014 License: BSD3. -} --------------------------------------------------------------------@@ -18,7 +18,8 @@ import Data.Time.Clock (getCurrentTime) import Prelude hiding (log) import Network (withSocketsDo)-import Network.HTTP.Conduit (newManager, def)+import Network.HTTP.Client (defaultManagerSettings)+import Network.HTTP.Conduit (newManager) import System.Console.CmdArgs import System.Exit (ExitCode(ExitSuccess), exitFailure, exitSuccess) import System.IO@@ -70,7 +71,7 @@ withStore "globals" $ do -- for readFeedFile -- http-conduit stuff withSocketsDo $ do -- for ms windows- manager <- io $ newManager Network.HTTP.Conduit.def+ manager <- io $ newManager defaultManagerSettings (opts,reader,bot) <- getRss2IrcArgs let app = App{aOpts=opts,aReader=reader{httpManager=Just manager},aBot=bot} when (delay opts > 0) $ threadDelay $ (delay opts) * minutes