4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
8 license-file: doc/LICENSE
11 doc/man1/htsn.1 test/xml/*.xml
13 Parse XML files from The Sports Network feed.
18 htsn [OPTIONS] [HOSTNAMES]
21 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
22 containing various sports news and statistics. The goal of /htsn/
23 is to watch the XML feed and parse the individual XML documents into
26 Once started, we will choose an XML feed host to connect to. The
27 choice is made from a list in a round-robin fashion, and by default,
28 the list contains all known TSN feed hosts. Once we have a connection,
29 your username and password are sent. If they are accepted, we begin to
30 parse the feed saving all XML files to the configured output directory
31 (see @--output-directory@).
33 If we encounter an error (say, the connection is dropped), then we
34 will attempt to connect to the next host in the list after waiting
35 five seconds. This process continues indefinitely.
37 The program can run either interactively (that is, outputting to the
38 console), or as a daemon with the @--daemonize@ flag.
42 The program takes no input; a username and password must be supplied
43 on the command-line or in a configuration file.
47 Output is not generated when running as a daemon; otherwise, standard
48 out and standard error are fairly noisy. All traffic between /htsn/ and
49 the feed server is displayed on stdout. Status messages are
50 interspersed when they are generated with warnings and errors going to
51 stderr. The following can be expected:
53 * The only data we send to the feed are the username and password.
54 These will be highlighted in green on stdout.
56 * All data received from the feed will be echoed in the default color
59 * Informational messages will be highlighted in cyan and sent to stdout.
61 * Warnings will be highlighted in yellow and sent to stderr.
63 * Errors will be highlighted in red and sent to stderr.
67 Logging is done either to syslog or a file. The destination and
68 verbosity are controlled by the @--log-file@, @--log-level@,
69 and @--syslog@ parameters which may be specified either on the command
70 line or in the configuration file.
78 Run as a daemon, in the background. When running as a daemon the
79 \--pidfile, --run-as-group, and --run-as-user flags become relevant.
87 If you specify a file here, logs will be written to it (possibly in
88 addition to syslog). Can be either a relative or absolute path. It
89 will not be auto-rotated; use something log logrotate for that.
97 How verbose should the logs be? We log notifications at three levels:
98 INFO, WARN, and ERROR. Specify the "most boring" level of
99 notifications you would like to receive (in all-caps); more
100 interesting notifications will be logged as well.
105 \--output-directory, -o
108 To which directory should we write the XML files?
116 The password associated with your TSN username. A password is
117 required, so you must supply one either on the command line or in a
126 (Daemon mode only) Create a PID file in the given location. This is
127 used by the init system on Unix to keep track of the running daemon.
129 Default: \/run\/htsn.pid
135 (Daemon mode only) Run as the given system group. The PID file is
136 written before privileges are dropped, so the only privileges needed
137 by /htsn/ are those necessary to write the XML files and (optionally)
140 Default: the current group
146 (Daemon mode only) Run as the given system user. The PID file is
147 written before privileges are dropped, so the only privileges needed
148 by /htsn/ are those necessary to write the XML files and (optionally)
151 Default: the current user
157 Enable logging to syslog. On Windows this will attempt to communicate
158 (over UDP) with a syslog daemon on localhost, which will most likely
167 Your TSN username. A username is required, so you must supply one
168 either on the command line or in a configuration file.
174 It is possible to pass a list of feed hostnames on the command-line
175 (see [HOSTNAMES] in the synopsis). By default /htsn/ will attempt
176 to connect to every known TSN XML feed host in a round-robin fashion,
177 so there is rarely a need to do this.
179 /Configuration File/:
181 Any of the command-line options mentioned above can be specified in a
182 configuration file instead. We look for a file named ".htsnrc"
183 in the user's home directory; its syntax is given by examples in the
184 htsnrc.example file (included with /htsn/).
186 If you are using the @--run-as-user@ option, that means that
187 the configuration file will need to go in that user's home directory
188 (and not, for example, root's).
190 Options specified on the command-line override those in the
196 ansi-terminal == 0.6.*,
199 configurator == 0.2.*,
208 tasty-hunit == 0.4.*,
209 transformers == 0.3.*,
223 OptionalConfiguration
232 -fwarn-missing-signatures
233 -fwarn-name-shadowing
237 -fwarn-incomplete-record-updates
238 -fwarn-monomorphism-restriction
239 -fwarn-unused-do-bind
254 type: exitcode-stdio-1.0
255 hs-source-dirs: src test
256 main-is: TestSuite.hs
258 ansi-terminal == 0.6.*,
261 configurator == 0.2.*,
270 tasty-hunit == 0.4.*,
271 transformers == 0.3.*,
274 -- It's not entirely clear to me why I have to reproduce all of this.
278 -fwarn-missing-signatures
279 -fwarn-name-shadowing
283 -fwarn-incomplete-record-updates
284 -fwarn-monomorphism-restriction
285 -fwarn-unused-do-bind
293 source-repository head
295 location: http://michael.orlitzky.com/git/htsn.git