]> gitweb.michael.orlitzky.com - dead/halcyon.git/commitdiff
Rename the project to Halcyon.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Aug 2013 00:39:40 +0000 (20:39 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 30 Aug 2013 00:39:40 +0000 (20:39 -0400)
doc/man1/halcyon.1 [moved from doc/man1/twat.1 with 62% similarity]
halcyon.cabal [moved from twat.cabal with 91% similarity]
makefile
src/CommandLine.hs
src/Main.hs
src/OptionalConfiguration.hs

similarity index 62%
rename from doc/man1/twat.1
rename to doc/man1/halcyon.1
index a3e89927eb84bc7ecba4f1d966724a634b6fee88..743b55b086f3edcfd50d0d687e8c03bf832116bd 100644 (file)
@@ -1,17 +1,18 @@
-.TH twat 1
+.TH halcyon 1
 
 .SH NAME
 
 .SH NAME
-twat \- Twat twats tweets so you don't have to Twitter.
+halcyon \- Halcyon monitors a list of Twitter accounts and displays or
+emails any new tweets.
 
 .SH SYNOPSIS
 
 
 .SH SYNOPSIS
 
-\fBtwat\fR [\fBOPTIONS\fR] [\fBUSERNAMES\fR]
+\fBhalcyon\fR [\fBOPTIONS\fR] [\fBUSERNAMES\fR]
 
 .SH INPUT
 
 .P
 
 .SH INPUT
 
 .P
-Twat takes no input proper; instead, it takes a list of usernames from
-either the command-line or the ~/.twatrc file, and watches those
+Halcyon takes no input proper; instead, it takes a list of usernames from
+either the command-line or the ~/.halcyonrc file, and watches those
 users' timelines.
 
 .SH OUTPUT
 users' timelines.
 
 .SH OUTPUT
@@ -19,24 +20,24 @@ users' timelines.
 .P
 Any new tweets from watched users are written to stdout. If to/from
 email addresses are provided (either on the command-line or in
 .P
 Any new tweets from watched users are written to stdout. If to/from
 email addresses are provided (either on the command-line or in
-~/.twatrc), then sendmail will be used to email the new tweet to the
+~/.halcyonrc), then sendmail will be used to email the new tweet to the
 specified \fIfrom\fR address.
 
 .SH DESCRIPTION
 
 .P
 specified \fIfrom\fR address.
 
 .SH DESCRIPTION
 
 .P
-Twat watches a list of Twitter timelines, and writes any new tweets to
+Halcyon watches a list of Twitter timelines, and writes any new tweets to
 stdout. It can also optionally email the new tweets to a given email
 address.
 .P
 New tweets are gathered at a fixed interval, specified in seconds by
 the \fB\-\-heartbeat\fR (default: 600) option.
 .P
 stdout. It can also optionally email the new tweets to a given email
 address.
 .P
 New tweets are gathered at a fixed interval, specified in seconds by
 the \fB\-\-heartbeat\fR (default: 600) option.
 .P
-Twat uses the Twitter API, which now requires you to have a developer
+Halcyon uses the Twitter API, which now requires you to have a developer
 account. You can sign up for free at https://dev.twitter.com/. Once
 you have done this, you can authorize your own account to access
 itself. You will then be given four tokens, which need to be fed to
 account. You can sign up for free at https://dev.twitter.com/. Once
 you have done this, you can authorize your own account to access
 itself. You will then be given four tokens, which need to be fed to
-twat:
+halcyon:
 
 .IP \[bu] 2
 Consumer Key
 
 .IP \[bu] 2
 Consumer Key
@@ -64,8 +65,8 @@ Your Twitter API access secret.
 .SH CONFIGURATION FILE
 
 .P
 .SH CONFIGURATION FILE
 
 .P
-The file ~/.twatrc can contain any of the options (and usernames) that
-would otherwise be specified on the command-line.
+The file ~/.halcyonrc can contain any of the options (and usernames)
+that would otherwise be specified on the command-line.
 
 .SH BUGS
 
 
 .SH BUGS
 
similarity index 91%
rename from twat.cabal
rename to halcyon.cabal
index d8180f9f617286696c8229e5333f1d56e63a24b0..8e8119f1c0cd1ea6557c852bed4788fd67f3c63b 100644 (file)
@@ -1,18 +1,19 @@
-name:           twat
-version:        0.0
+name:           halcyon
+version:        0.0.1
 cabal-version:  >= 1.8
 author:         Michael Orlitzky
 maintainer:    Michael Orlitzky <michael@orlitzky.com>
 license:        GPL-3
 license-file:   doc/LICENSE
 cabal-version:  >= 1.8
 author:         Michael Orlitzky
 maintainer:    Michael Orlitzky <michael@orlitzky.com>
 license:        GPL-3
 license-file:   doc/LICENSE
-homepage:       http://michael.orlitzky.com/code/twat.php
+homepage:       http://michael.orlitzky.com/code/halcyon.php
 bug-reports:    mailto:michael@orlitzky.com
 category:       Utils, Web
 synopsis:
 bug-reports:    mailto:michael@orlitzky.com
 category:       Utils, Web
 synopsis:
-  Twat twats tweets so you don't have to Twitter.
+  Halcyon monitors a list of Twitter accounts and displays or emails
+  any new tweets.
 build-type:     Simple
 
 build-type:     Simple
 
-executable twat
+executable halcyon
   build-depends:
     aeson                       == 0.6.*,
     authenticate-oauth          == 1.4.*,
   build-depends:
     aeson                       == 0.6.*,
     authenticate-oauth          == 1.4.*,
@@ -110,5 +111,5 @@ test-suite testsuite
 
 source-repository head
   type: git
 
 source-repository head
   type: git
-  location: http://michael.orlitzky.com/git/twat.git
+  location: http://michael.orlitzky.com/git/halcyon.git
   branch: master
   branch: master
index 986de5c65e6fc0f1f92a71bf8353c8596516699c..00368eaae80441a0e4698fa3eb474523b566972e 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
-BIN           = dist/build/twat/twat
+BIN           = dist/build/halcyon/halcyon
 TESTSUITE_BIN = dist/build/testsuite/testsuite
 
 .PHONY : dist doc test
 TESTSUITE_BIN = dist/build/testsuite/testsuite
 
 .PHONY : dist doc test
index cf63b48e696c84bcfddfd74a3df506c49d2af46a..06c072e8715af292cb8a5d83ffa5ed0cd29b2aa4 100644 (file)
@@ -11,17 +11,18 @@ import System.Exit (ExitCode(..), exitWith)
 import System.IO (hPutStrLn, stderr)
 
 -- Get the version from Cabal.
 import System.IO (hPutStrLn, stderr)
 
 -- Get the version from Cabal.
-import Paths_twat (version)
+import Paths_halcyon (version)
 import Data.Version (showVersion)
 
 import ExitCodes
 import OptionalConfiguration
 
 description :: String
 import Data.Version (showVersion)
 
 import ExitCodes
 import OptionalConfiguration
 
 description :: String
-description = "Twat twats tweets so you don't have to twitter."
+description =
+  "Monitor a list of Twitter accounts and display or email any new tweets."
 
 program_name :: String
 
 program_name :: String
-program_name = "twat"
+program_name = "halcyon"
 
 my_summary :: String
 my_summary = program_name ++ "-" ++ (showVersion version)
 
 my_summary :: String
 my_summary = program_name ++ "-" ++ (showVersion version)
index b4fd956f2114d1f3a32f2b6126572811aa603a20..c104874c9c7b026d45d0de5f71c817385eb145c8 100644 (file)
@@ -39,7 +39,7 @@ thread_sleep seconds = do
 -- /Date: / header, and returns the updated message.
 message_from_status :: Maybe TimeZone -> Message -> String -> Status -> Message
 message_from_status mtz message default_date status =
 -- /Date: / header, and returns the updated message.
 message_from_status :: Maybe TimeZone -> Message -> String -> Status -> Message
 message_from_status mtz message default_date status =
-  message { subject = "Twat: " ++ (screen_name (user status)),
+  message { subject = "Halcyon: " ++ (screen_name (user status)),
             body    = (pretty_print mtz status),
             headers = ((headers message) ++ ["Date: " ++ date])}
   where
             body    = (pretty_print mtz status),
             headers = ((headers message) ++ ["Date: " ++ date])}
   where
@@ -166,8 +166,8 @@ get_latest_status_id cfg username = do
 --   recursive loop that checks for updates forever. The message
 --   argument is optional and is passed to recurse in case the updates
 --   should be emailed.
 --   recursive loop that checks for updates forever. The message
 --   argument is optional and is passed to recurse in case the updates
 --   should be emailed.
-run_twat :: Cfg -> Maybe Message -> String -> IO ()
-run_twat cfg msg username = do
+run :: Cfg -> Maybe Message -> String -> IO ()
+run cfg msg username = do
   latest_status_id <- get_latest_status_id cfg username
   recurse cfg username latest_status_id msg
   return ()
   latest_status_id <- get_latest_status_id cfg username
   recurse cfg username latest_status_id msg
   return ()
@@ -189,7 +189,7 @@ construct_message cfg = do
                              from = f }
 
 -- |The main function just parses the command-line arguments and then
                              from = f }
 
 -- |The main function just parses the command-line arguments and then
--- forks off calls to 'run_twat' for each supplied username. After
+-- forks off calls to 'run' for each supplied username. After
 -- forking, main loops forever.
 main :: IO ()
 main = do
 -- forking, main loops forever.
 main :: IO ()
 main = do
@@ -214,9 +214,9 @@ main = do
   -- message object to be passed to all of our threads.
   let message = construct_message cfg
 
   -- message object to be passed to all of our threads.
   let message = construct_message cfg
 
-  -- Execute run_twat on each username in a new thread.
-  let run_twat_curried = run_twat cfg message
-  _ <- mapM (forkIO . run_twat_curried) (get_usernames (usernames cfg))
+  -- Execute run on each username in a new thread.
+  let run_curried = run cfg message
+  _ <- mapM (forkIO . run_curried) (get_usernames (usernames cfg))
 
   _ <- forever $
     -- This thread (the one executing main) doesn't do anything,
 
   _ <- forever $
     -- This thread (the one executing main) doesn't do anything,
index 77b3a06d2c42bef78908bdc09827cad73e91988d..0b5fd0a6b05cc0cd6ba5ee63a6cb3a5c342f0405 100644 (file)
@@ -2,7 +2,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE OverloadedStrings #-}
 
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE OverloadedStrings #-}
 
--- | The program will parse ~/.twatrc for any available configuration
+-- | The program will parse ~/.halcyonrc for any available configuration
 --   directives, resulting in an OptionalCfg. The command-line
 --   arguments will be used to create another OptionalCfg, and the two
 --   will be merged. Finally, a default_config will be updated from
 --   directives, resulting in an OptionalCfg. The command-line
 --   arguments will be used to create another OptionalCfg, and the two
 --   will be merged. Finally, a default_config will be updated from
@@ -89,7 +89,7 @@ instance Monoid OptionalCfg where
 
 from_rc :: IO OptionalCfg
 from_rc = do
 
 from_rc :: IO OptionalCfg
 from_rc = do
-  cfg <- DC.load [ DC.Optional "$(HOME)/.twatrc" ]
+  cfg <- DC.load [ DC.Optional "$(HOME)/.halcyonrc" ]
   cfg_consumer_key <- DC.lookup cfg "consumer-key"
   cfg_consumer_secret <- DC.lookup cfg "consumer-secret"
   cfg_access_token <- DC.lookup cfg "access-token"
   cfg_consumer_key <- DC.lookup cfg "consumer-key"
   cfg_consumer_secret <- DC.lookup cfg "consumer-secret"
   cfg_access_token <- DC.lookup cfg "access-token"