By | fr33domlover |
At | 2016-02-18 |
Title | Add feed debug config option |
Description |
Edit file funbot.cabal 33188 → 33188
99 99 , case-insensitive >=1
100 100 , clock >=0.5
101 101 , containers >=0.5
102 102 , data-default-class
103 103 , feed
- 104 , feed-collect >=0.2
+ 104 , feed-collect >=0.2.0.2
105 105 , formatting >=6.2
106 106 , funbot-ext-events >=0.3
107 107 , hashable
108 108 , HTTP
109 109 , http-client >=0.4.19
… … … … Edit file src/FunBot/Config.hs 33188 → 33188
20 20 , configuration
21 21 , webListenerPort
22 22 , webErrorLogFile
23 23 , feedErrorLogFile
24 24 , feedVisitInterval
+ 25 , feedDebug
25 26 , settingsFilename
26 27 , memosFilename
27 28 , userOptsFilename
28 29 , nicksFilename
29 30 , quoteDir
… … … … 63 64 webErrorLogFile = "state/web-error.log"
64 65 65 66 feedErrorLogFile = "state/feed-error.log"
66 67 67 68 feedVisitInterval = 5 :: Minute
+ 69 + 70 feedDebug = False
68 71 69 72 -- | If you set a repo path in the configuration above ('stateRepo' field),
70 73 -- then this path is relative to that repo and the settings file will be
71 74 -- commited to Git. Otherwise, this path is relative to the bot process working
72 75 -- dir (or absolute), and Git won't be used.
… … … … Edit file src/FunBot/Sources/FeedWatcher.hs 33188 → 33188
21 21 where
22 22 23 23 import Data.Maybe (fromMaybe)
24 24 import Data.Default.Class (def)
25 25 import Data.Time.Interval (time)
- 26 import FunBot.Config (feedVisitInterval)
+ 26 import FunBot.Config (feedVisitInterval, feedDebug)
27 27 import FunBot.ExtEvents (ExtEvent (NewsEvent), NewsItem (..))
28 28 import FunBot.Types
29 29 import Network.IRC.Fun.Bot.Logger
30 30 import Text.Feed.Query
31 31 import Text.Feed.Types (Feed, Item)
… … … … 58 58 pairs = M.toList $ stWatchedFeeds $ bsSettings state
59 59 mkfeed (label, nf) = def
60 60 { fcLabel = T.unpack $ CI.original$ unFeedLabel $ label
61 61 , fcUrl = T.unpack $ nfUrl nf
62 62 , fcActive = nfActive nf
+ 63 , fcDebug = feedDebug
63 64 }
64 65 feeds = map mkfeed pairs
65 66 putStrLn "Bot: Feed watcher source loop running"
66 67 run def
67 68 { wcCollect = collect push
68 69 , wcLogError = logError logger
69 70 , wcCommandQueue = Just cq
70 71 , wcVisitInterval = time feedVisitInterval
71 72 , wcMaxItems = 3
72 73 , wcFeeds = feeds
+ 74 , wcDebug = def
+ 75 { dcDebugCycle = feedDebug
+ 76 }
73 77 }
… … … …