This gem includes various Calibre -related utilities.
For the moment a wrapper around the calibredb
utility with more output formats.
It is not yet published on http://rubygems.org so you'll need to fork the project
with git
and use bundler
and rake
to do it manually.
bundle
rake install
It should install the dependencies itself automagically (namely Ox
& Oj
for
XML and JSON support and pastebin
for -P
support. gem
should to the right thing
when installing.
You MUST install the command-line utilities from within Calibre for this to
work as it relies on calibredb
for querying the library.
You MUST also have a custom column named 'Added:' that is supposed to have the
date each book was added, or edit the source to change #added:
into date:
.
The default configuration file in the TOML
format and located by default in $HOME/.books-utils/config.toml
is not optional
anymore as it now contains some of the previously hardcoded variables.
newer-than v
Usage: newer-than [-hqvPZ] [-D path] [-c RCFILE] [-f format] [-o DIR] [-d DATE | -t DAYS]
Default is 1 day. Default format is space-delimited.
-D, --library=DIR Use that library path instead of the default.
-P, --pastebin Post directly to pastebin.
-Z, --zip Generate a zip file with the new files.
-c, --config-file=FILE Specify a configuration file, default is ~/.@conf/books-utils.yml
-d, --since=DATE Use that date to search after
-f, --format=json|rss|yaml|xml Specify output format
--output-dir=DIR Set output dir for -Z, default is "/tmp".
-q, --quiet Do not display the result (generally with -P).
-t, --newer-than=DAYS Threshold date to look for
-h, --help Display this usage
-d ALL
lists all books.
To post directly into a pastebin, install the pastebin
gem and use
newer-than -dYYYY-MM-DD -P
You may need to get an API key for pastebin, see the pastebin API.
If you want to generate a Zip file with all new files, please use -Z
. Default directory is /tmp
. The filename will have the date specified.
The default is a simple space-delimited output, suited for cut&paste. You can also generate JSON,
YAML, RSS or XML by specifying the -f
option. RSS variant is Atom only for the moment.
It should run on most Ruby implementations, it has been tested with Ruby MRI 2.x and Rubinius 2.2.*.
Not tested on Windows at all, no system to check on. Developped & Tested on OS X. Should work on FreeBSD and Linux. If not please submit issues (and patch if you can).
- Fork it ( https://github.com/keltia/books-utils/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request