[Adding pubDates to items when missing Manuel M T Chakravarty **20060506045638] { hunk ./Config.hs 32 - when, foldM) + when, unless, foldM) hunk ./Config.hs 138 - (opts, [] , [] ) -> processVersion opts >>= - processHelp >>= - processConfig dftConfig + (opts, [] , [] ) -> do + processVersion opts + processHelp opts + processConfig dftConfig opts hunk ./Config.hs 150 -processVersion :: [Option] -> IO [Option] +processVersion :: [Option] -> IO () hunk ./Config.hs 157 - if Help `elem` opts then return opts else exitSuccess + unless (Help `elem` opts) $ + exitSuccess + return () hunk ./Config.hs 163 -processHelp :: [Option] -> IO [Option] +processHelp :: [Option] -> IO () hunk ./Config.hs 171 - return opts + return () hunk ./LambdaFeed.hs 20 --- Complete feed items include a timestamp. If they don't, the timestamp of --- the file containing an item is appended to the item contents. +-- We require all channel items to include a timestamp (aka publication +-- date). If an item doesn't contain an explicit `pubDate' field, the last +-- modification date of the file containing the item is added as a +-- `pubDate'. This holds only for channel items, not for channel +-- descriptions. hunk ./LambdaFeed.hs 52 +-- `pubDate' : using file modification time if absent (only for items) hunk ./LambdaFeed.hs 76 +-- * Options to truncate news streams during formatting: (1) Maximal number +-- of items rendered, (2) cut off date for rendering, and (3) maximum age +-- of items to render. We should be able to specify this either for the +-- XML and HTML output together or for both separately (as with output +-- directory). This could also be realised by synthetic channels being able +-- to specify such criteria. +-- hunk ./LambdaFeed.hs 87 +-- * Should also have a CGI script mode, where it dumps either the XML or +-- HTML to stdout. (Could also do that via a shell script, but Haskell may +-- be more portable. However, CGI "scripts" could be separate, small +-- Haskell programs.) +-- hunk ./LambdaFeed.hs 94 --- * Don't regenerate a channel if neither its description nor items changed. +-- * Don't regenerate a channel if neither its description nor items changed +-- and/or some caching. hunk ./LambdaFeed.hs 242 - let (chan, errs) = parseItem fname text + let (item, errs) = parseItem fname text hunk ./LambdaFeed.hs 244 - return chan + pubDate <- case pubDateItem item of + Just pubDate -> return pubDate + Nothing -> do + currTime <- liftM Date $ getClockTime + appendFile fname $ "\n\nPubDate: " ++ show currTime ++ "\n" + return currTime + return $ item {pubDateItem = Just pubDate} hunk ./test/polar/morefish.lfi 8 - }