Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Created June 6, 2009 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonmichael/124760 to your computer and use it in GitHub Desktop.
Save simonmichael/124760 to your computer and use it in GitHub Desktop.
-- help :: IO ()
help = do
putStrLn "rss2irc [--links] <server> <port> <channel> <nick> <feed-url> <msg-prefix> <interval>"
exitWith ExitSuccess
main :: IO ()
main = do
(flags, args, errs) <- getOpt Permute [Option ['l'] ["links"] (NoArg Links) "include link URLs"] `fmap` getArgs
when (not . null $ errs) help
let l = Links `elem` flags
(st, feed, prefix, interval) <- case args of
[s,p,c,n,f,z,i] | Just intp <- maybeRead p, Just inti <- maybeRead i ->
return (Bot { socket = stdout
, server = s
, port = intp
, channel = c
, nick = n
, links = l }
,f, z, inti)
_ -> help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment