CLI for reading swedish text-tv
txtv - A client for reading swedish text tv in the terminal
Text-tv is great! plaintext and to-the-point news with no filler. Now you can read it without touching your mouse or your tv-remote :)
If you have Python 3.6 or later with pip installed, just run
pip3 install --user txtv
Running with no arguments will enter interactive mode.
From there you can run any of these commands:
help | h | ? -- show this help text. quit | q | exit -- quit the program (duh) list | ls | l -- list all articles next | n | > -- show next available page. previous | prev | p | < -- show previous available page. <PAGE NUMBER> -- show the page at the specified number
You can also give any of these commands as an argument on the normal command line to run un-interactively. Except for
previous, because that would make no sense.
txtv 100 # show page 100 txtv ls # list all news articles
txtv.py will automatically generate a config file at
~/.config/txtv/txtv.cfg with default values. It uses format of configparser.
under the alias category you can specify any number of aliases for txtv commands. These will work both in interactive mode and as subcommands when calling txtv from your shell.
will let you list all articles from shell with
or by typing
all in interactive mode.
So far there is only one option here, named
prompt. It is just the prompt string used in interactive mode.
[general] prompt = kommandorörelse>
Here you can filter out some parts of the pages you might find unnecessary or distracting. These are all boolean variables and the accepted values are those that configparser accepts as true/false:
... config parsers consider the following values True: '1', 'yes', 'true', 'on' and the following values False: '0', 'no', 'false', 'off'.
these are all on by default.
|svt_header||The line at the top that looks like
|publicerad_header||The blue line that says when the article was published (
|navigation_footer||The bottom line that usually says
Right now the most interesting thing there is aliases which work both in CLI mode and interactive mode. You can also change what your interactive prompt looks like if you care about that.
Here is the trello for the development of txtv: https://trello.com/b/aBI0DpN3/txtv
Here is where it's scraping data from: https://www.svt.se/svttext/web/pages/100.html
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.