4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
8 license-file: doc/LICENSE
16 Parse XML files from The Sports Network feed.
21 htsn [OPTIONS] [HOSTNAMES]
24 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
25 containing various sports news and statistics. The goal of /htsn/
26 is to watch the XML feed and parse the individual XML documents into
29 Once started, we will choose an XML feed host to connect to. The
30 choice is made from a list in a round-robin fashion, and by default,
31 the list contains all known TSN feed hosts. Once we have a connection,
32 your username and password are sent. If they are accepted, we begin to
33 parse the feed saving all XML files to the configured output directory
34 (see @--output-directory@).
36 If we encounter an error (say, the connection is dropped), then we
37 will attempt to connect to the next host in the list after waiting
38 five seconds. This process continues indefinitely.
40 The program can run either interactively (that is, outputting to the
41 console), or as a daemon with the @--daemonize@ flag.
45 The program takes no input; a username and password must be supplied
46 on the command-line or in a configuration file.
50 Output is not generated when running as a daemon; otherwise, standard
51 out and standard error are fairly noisy. All traffic between /htsn/ and
52 the feed server is displayed on stdout. Status messages are
53 interspersed when they are generated with warnings and errors going to
54 stderr. The following can be expected:
56 * The only data we send to the feed are the username and password.
57 These will be highlighted in green on stdout.
59 * All data received from the feed will be echoed in the default color
62 * Informational messages will be highlighted in cyan and sent to stdout.
64 * Warnings will be highlighted in yellow and sent to stderr.
66 * Errors will be highlighted in red and sent to stderr.
70 Logging is done either to syslog or a file. The destination and
71 verbosity are controlled by the @--log-file@, @--log-level@,
72 and @--syslog@ parameters which may be specified either on the command
73 line or in the configuration file.
81 Run as a daemon, in the background. When running as a daemon the
82 \--pidfile, --run-as-group, and --run-as-user flags become relevant.
90 If you specify a file here, logs will be written to it (possibly in
91 addition to syslog). Can be either a relative or absolute path. It
92 will not be auto-rotated; use something log logrotate for that.
100 How verbose should the logs be? We log notifications at three levels:
101 INFO, WARN, and ERROR. Specify the \"most boring\" level of
102 notifications you would like to receive (in all-caps); more
103 interesting notifications will be logged as well.
108 \--output-directory, -o
111 To which directory should we write the XML files?
119 The password associated with your TSN username. A password is
120 required, so you must supply one either on the command line or in a
129 (Daemon mode only) Create a PID file in the given location. This is
130 used by the init system on Unix to keep track of the running daemon.
132 If necessary, its parent directory will be created with owner/group
133 set to the appropriate user/group, but at most one directory will
134 be created (that is, we won't create an entire directory tree).
136 Default: \/run\/htsn\/htsn.pid
142 (Daemon mode only) Run as the given system group. The PID file is
143 written before privileges are dropped, so the only privileges needed
144 by /htsn/ are those necessary to write the XML files and (optionally)
147 Default: the current group
153 (Daemon mode only) Run as the given system user. The PID file is
154 written before privileges are dropped, so the only privileges needed
155 by /htsn/ are those necessary to write the XML files and (optionally)
158 Default: the current user
164 Enable logging to syslog. On Windows this will attempt to communicate
165 (over UDP) with a syslog daemon on localhost, which will most likely
174 Your TSN username. A username is required, so you must supply one
175 either on the command line or in a configuration file.
181 It is possible to pass a list of feed hostnames on the command-line
182 (see [HOSTNAMES] in the synopsis). By default /htsn/ will attempt
183 to connect to every known TSN XML feed host in a round-robin fashion,
184 so there is rarely a need to do this.
186 /Configuration File/:
188 Any of the command-line options mentioned above can be specified in a
189 configuration file instead. We first look for \"htsnrc\" in the
190 system configuration directory. We then look for a file named
191 \".htsnrc\" in the user's home directory. The latter will override
194 The user's home directory is simply $HOME on Unix; on Windows its
195 wherever %APPDATA% points. The system configuration directory
196 is determined by Cabal; the /sysconfdir/ parameter during
197 the \"configure\" step is used.
199 The file's syntax is given by examples in the htsnrc.example file
200 (included with /htsn/).
202 Options specified on the command-line override those in either
210 configurator == 0.2.*,
215 htsn-common == 0.0.1,
220 tasty-hunit == 0.4.*,
234 OptionalConfiguration
241 -fwarn-missing-signatures
242 -fwarn-name-shadowing
246 -fwarn-incomplete-record-updates
247 -fwarn-monomorphism-restriction
248 -fwarn-unused-do-bind
263 type: exitcode-stdio-1.0
264 hs-source-dirs: src test
265 main-is: TestSuite.hs
269 configurator == 0.2.*,
274 htsn-common == 0.0.1,
279 tasty-hunit == 0.4.*,
282 -- It's not entirely clear to me why I have to reproduce all of this.
286 -fwarn-missing-signatures
287 -fwarn-name-shadowing
291 -fwarn-incomplete-record-updates
292 -fwarn-monomorphism-restriction
293 -fwarn-unused-do-bind
301 source-repository head
303 location: http://michael.orlitzky.com/git/htsn.git