writer tools

Documentation
Login

% SAMLIB_BOT(1) % Victor Wagner vitus@wagner.pp.ru % July 2018

NAME

samlib_bot - uploads boors to samlib.ru

SYNOPSIS

samlib_bot -v [options] filename.html [site_url]

DESCRIPTION

This is a simple python script which uploads html file to http://samlib.ru. First and only required argument is the name of the file.

It expects input file be in utf-8 encoding (typically, produced by pandoc(1) ).

It uses .netrc file to find out username and password unless they are explicitely specified in the command line.

If this book already exists on the current user's page, it tries to copy all existing metainformation such as title, first submission date genre etc, unless overridden in the command line.

Book page name (without .shtml extension) can be specified as second non-option argument or it is derived from input file name.

Input file can contain characters from foreign languages and other Unicode symbols irrepresentable in the samlib.ru database. They are converted into html entities.

OPTIONS

Technical

-u username, --user username

: Specify user explicitely, if you don't want to use .netrc. You'll need to specify password as well.

-p password, --password password

: Specify password if you don't want to use .netrc

-h, --help*

: Output brief usage message.

-v, --verbose

: Output some information about progress

Book metainformation

-a text, --annotation= text

: Set annotation. There is no possibility to use characters other than 26 latin, 36 cyrillic letters and standard ASCII punctuation in annotation. Default (for new book) is empty.

-d date, --date date

: date of the first publication. Format DD/MM/YYYY.

-f format, --format

: Format of the literature work (i.e. novel, short story etc)

-g group, --group group

: Group of the file. Specify text which appear in the samlib menu, not number appearing in the html source.

-j genre, --janre genre

: Specify genre of the book

-t title, --title title

: Title (to appear on the authors page). If none specifed for the new book, it is extracted from html page title.

FILES

.netrc is used to get user and password for samlib.ru

BUGS

Doesn't analyze result page for upload errors.

REQUIREMENTS

This script requires python 3.5 or above and requests 2.19 or above. All modules used besides requests are from python standard library.

AUTHOR

Victor Wagner vitus@wagner.pp.ru

SEE ALSO

.netrc*(5), pandoc(1)