2019-05-11 02:52:33 +02:00
|
|
|
= remwharead(1)
|
|
|
|
:doctype: manpage
|
|
|
|
:Author: tastytea
|
|
|
|
:Email: tastytea@tastytea.de
|
2019-07-25 03:38:26 +02:00
|
|
|
:Date: 2019-07-25
|
2019-05-11 02:52:33 +02:00
|
|
|
:Revision: 0.0.0
|
|
|
|
:man source: remwharead
|
|
|
|
:man manual: General Commands Manual
|
|
|
|
|
|
|
|
== NAME
|
|
|
|
|
2019-05-16 13:18:16 +02:00
|
|
|
remwharead - Saves URIs of things you want to remember in a database
|
2019-05-11 02:52:33 +02:00
|
|
|
|
|
|
|
== SYNOPSIS
|
|
|
|
|
2019-05-22 09:51:58 +02:00
|
|
|
*remwharead* [*-t* _tags_] [*-N*] _URI_
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-07-25 03:38:26 +02:00
|
|
|
*remwharead* *-e* _format_ [*-f* _file_] [*-T* _start_,_end_] [[*-s*|*-S*] _expression_] [*-r*]
|
2019-05-11 02:52:33 +02:00
|
|
|
|
|
|
|
== DESCRIPTION
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-16 13:18:16 +02:00
|
|
|
*remwharead* saves URIs of things you want to remember in a database along with
|
|
|
|
an URI to the archived version, the current date and time, title, description,
|
|
|
|
the full text of the page and optional tags.
|
2019-05-11 02:52:33 +02:00
|
|
|
|
2019-05-26 20:10:45 +02:00
|
|
|
The database can be filtered by time, tags and full text and exported to CSV,
|
|
|
|
AsciiDoc or a bookmarks file.
|
2019-05-22 09:28:12 +02:00
|
|
|
|
|
|
|
Archiving is done using the Wayback machine from the
|
|
|
|
https://archive.org/[Internet Archive].
|
|
|
|
|
2019-05-11 02:52:33 +02:00
|
|
|
== OPTIONS
|
|
|
|
|
2019-05-13 02:17:25 +02:00
|
|
|
*-t* _tags_, *--tags* _tags_::
|
2019-05-16 08:36:35 +02:00
|
|
|
Add tags to _URI_, delimited by commas.
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-13 02:17:25 +02:00
|
|
|
*-e* _format_, *--export* _format_::
|
2019-07-21 16:39:36 +02:00
|
|
|
Export to _format_. Possible values are _csv_, _asciidoc_, _bookmarks_ or
|
2019-07-21 17:15:55 +02:00
|
|
|
_simple_. See _FORMATS_.
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-13 02:17:25 +02:00
|
|
|
*-f* _file_, *--file* _file_::
|
2019-05-11 18:40:50 +02:00
|
|
|
Save output to _file_. Default is stdout.
|
|
|
|
|
2019-05-22 09:51:58 +02:00
|
|
|
*-T* _start_,_end_, *--time-span* _start_,_end_::
|
2019-05-16 00:26:48 +02:00
|
|
|
Only export entries between and including _start_ and _end_. _start_ and _end_
|
2019-05-16 07:54:56 +02:00
|
|
|
are date and time representations according to ISO 8601
|
|
|
|
(YYYY-MM-DDThh:mm:ss). Time zones are ignored.
|
|
|
|
Example: `--span 2019-01-01,2019-02-10T12:30`.
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-19 05:33:06 +02:00
|
|
|
*-s* _expression_, *--search-tags* _expression_::
|
2019-05-22 13:30:42 +02:00
|
|
|
Search in tags. Format: _tag1 AND tag2 OR tag3_. See _SEARCH EXPRESSIONS_. Case
|
|
|
|
insensitive.
|
2019-05-19 05:33:06 +02:00
|
|
|
|
2019-05-22 09:51:58 +02:00
|
|
|
*-S* _expression_, *--search-all* _expression_::
|
2019-07-21 17:45:17 +02:00
|
|
|
Search in tags, title, description and full text. See _SEARCH EXPRESSIONS_. Case
|
2019-05-22 13:30:42 +02:00
|
|
|
insensitive.
|
2019-05-19 05:33:06 +02:00
|
|
|
|
2019-07-25 03:38:26 +02:00
|
|
|
*-r*, *--regex*::
|
|
|
|
Use regular expressions for search, case insensitive. With *--search-tags*,
|
|
|
|
every tag is enclosed by _^_ and _$_.
|
|
|
|
|
2019-05-22 09:43:58 +02:00
|
|
|
*-N*, *--no-archive*::
|
|
|
|
Do not archive URI.
|
|
|
|
|
2019-05-12 00:02:31 +02:00
|
|
|
*-h*, *--help*::
|
|
|
|
Show help message.
|
|
|
|
|
|
|
|
*-V*, *--version*::
|
2019-05-11 02:52:33 +02:00
|
|
|
Print version, copyright and license.
|
|
|
|
|
|
|
|
== EXAMPLES
|
|
|
|
|
2019-05-19 04:56:35 +02:00
|
|
|
.Save a thing into the database, with tags.
|
|
|
|
====
|
2019-05-13 02:17:25 +02:00
|
|
|
`remwharead -t tag1,tag2 https://example.com/article.html`
|
2019-05-19 04:56:35 +02:00
|
|
|
====
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-19 04:56:35 +02:00
|
|
|
.Export all things between and including 2019-04-01 and 2019-05-31 to a file.
|
|
|
|
====
|
2019-05-22 09:51:58 +02:00
|
|
|
`remwharead -e asciidoc -f out.adoc -T 2019-04-01,2019-05-31`
|
2019-05-19 04:56:35 +02:00
|
|
|
====
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-19 04:56:35 +02:00
|
|
|
.Export all things to an HTML file.
|
|
|
|
====
|
2019-05-13 02:17:25 +02:00
|
|
|
`remwharead -e asciidoc | asciidoctor --backend=html5 --out-file=out.html -`
|
2019-05-19 04:56:35 +02:00
|
|
|
====
|
2019-05-11 18:40:50 +02:00
|
|
|
|
2019-05-19 05:33:06 +02:00
|
|
|
.Export all things about GRUB the boot-loader, but nothing about caterpillars.
|
|
|
|
====
|
2019-05-19 09:52:39 +02:00
|
|
|
`remwharead -e csv -s "grub AND boot"`
|
2019-05-19 05:33:06 +02:00
|
|
|
====
|
|
|
|
|
2019-07-25 03:38:26 +02:00
|
|
|
.Output all articles by Jan Müller, consider different spellings.
|
|
|
|
====
|
2019-07-25 04:11:10 +02:00
|
|
|
`remwharead -e simple -S 'Jan\[[:space:]]+M(ü|ue)ller' -r`
|
2019-07-25 03:38:26 +02:00
|
|
|
====
|
|
|
|
|
2019-05-26 20:10:45 +02:00
|
|
|
=== Display database
|
|
|
|
|
|
|
|
*remwharead* does not provide an interface to display the database. However, you
|
|
|
|
can periodically generate an HTML file with cron and display it in the browser.
|
|
|
|
|
|
|
|
.Line from crontab: Generate an HTML file of the last 6 months every 30 minutes.
|
|
|
|
====
|
|
|
|
[source,crontab]
|
|
|
|
----
|
|
|
|
*/30 * * * * remwharead -e asciidoc -T $(date -d "-6 months" -I),$(date -I) | asciidoctor --backend=html5 --out-file=${HOME}/remwharead.html -
|
|
|
|
----
|
|
|
|
====
|
|
|
|
|
2019-05-16 03:56:17 +02:00
|
|
|
== FORMATS
|
|
|
|
|
2019-05-19 13:46:47 +02:00
|
|
|
=== csv
|
2019-05-16 03:56:17 +02:00
|
|
|
|
|
|
|
CSV is short for comma separated values. All fields are quoted and delimited by
|
|
|
|
commas. Line breaks in the full text are converted to "\n". Our CSV
|
|
|
|
implementation follows RFC 4180 and the full MIME media type is
|
|
|
|
`text/csv;charset=utf-8;header=present`.
|
|
|
|
|
2019-05-19 13:46:47 +02:00
|
|
|
=== asciidoc
|
2019-05-16 08:37:50 +02:00
|
|
|
|
|
|
|
AsciiDoc is a markup language that can be read as plain text or converted to
|
|
|
|
HTML, PDF and many other formats.
|
|
|
|
|
2019-05-26 15:47:06 +02:00
|
|
|
=== bookmarks
|
|
|
|
|
|
|
|
The
|
|
|
|
https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa753582(v=vs.85)[Netscape
|
|
|
|
Bookmark file format] is a format for exporting and importing bookmarks that is
|
|
|
|
understood by most browsers.
|
|
|
|
|
2019-07-21 16:39:36 +02:00
|
|
|
=== simple
|
|
|
|
|
|
|
|
Simple, human readable, list. Outputs date, title and URI.
|
|
|
|
|
2019-05-19 05:33:06 +02:00
|
|
|
== SEARCH EXPRESSIONS
|
|
|
|
|
|
|
|
A search expression is either a single term, or several terms separated by _AND_
|
|
|
|
or _OR_. _AND_ takes precedence. The expression _Mountain AND Big OR Vegetable_
|
2019-05-19 15:46:07 +02:00
|
|
|
finds all things that have either Mountain and Big, or Vegetable in them. You can
|
2019-05-19 12:50:23 +02:00
|
|
|
use _||_ instead of _OR_ and _&&_ instead of _AND_. Note that *--search-tags*
|
2019-05-19 15:46:07 +02:00
|
|
|
only matches whole tags, Pill does not match Pillow.
|
2019-05-19 05:33:06 +02:00
|
|
|
|
2019-05-18 01:36:19 +02:00
|
|
|
== PROTOCOL SUPPORT
|
|
|
|
|
2019-05-26 20:10:45 +02:00
|
|
|
Since *remwharead* is built on libcurl, it supports the same protocols. See
|
|
|
|
*curl*(1), section _DESCRIPTION_. Titles and descriptions are currently only
|
|
|
|
extracted when using HTTP(S).
|
2019-05-18 01:36:19 +02:00
|
|
|
|
|
|
|
== ENVIRONMENT
|
|
|
|
|
|
|
|
You can use proxy servers with the same environment variables as curl. See
|
|
|
|
*curl*(1), section _ENVIRONMENT_.
|
|
|
|
|
2019-05-11 02:52:33 +02:00
|
|
|
== FILES
|
|
|
|
|
2019-05-14 22:56:58 +02:00
|
|
|
* *Database*: `${XDG_DATA_HOME}/remwharead/database.sqlite`
|
2019-05-11 02:52:33 +02:00
|
|
|
|
2019-05-11 18:40:50 +02:00
|
|
|
`${XDG_DATA_HOME}` is usually `~/.local/share`.
|
2019-05-11 02:52:33 +02:00
|
|
|
|
2019-05-18 13:51:58 +02:00
|
|
|
== ERROR CODES
|
|
|
|
|
|
|
|
[options="header",cols=">,<"]
|
|
|
|
|==================================================
|
|
|
|
| Code | Explanation
|
|
|
|
| 1 | Missing options / Argument not understood.
|
|
|
|
| 2 | Database connection failed.
|
|
|
|
| 3 | File could not be opened.
|
|
|
|
| 4 | Could not fetch URI.
|
|
|
|
|==================================================
|
|
|
|
|
2019-05-18 01:36:19 +02:00
|
|
|
== SEE ALSO
|
|
|
|
|
2019-05-26 20:10:45 +02:00
|
|
|
*curl*(1), *crontab*(1), *crontab*(5)
|
2019-05-18 01:36:19 +02:00
|
|
|
|
2019-05-11 02:52:33 +02:00
|
|
|
== REPORTING BUGS
|
|
|
|
|
|
|
|
Bugtracker: https://schlomp.space/tastytea/remwharead/issues
|
|
|
|
|
|
|
|
E-mail: tastytea@tastytea.de
|