Migration to sqlite3 started

This commit is contained in:
Luxferre
2024-10-23 20:27:03 +03:00
parent 5c1b6570df
commit a86bb5a0e6
3 changed files with 96 additions and 141 deletions
+13 -26
View File
@@ -14,7 +14,7 @@ The tii repo consists of the following parts:
* tiifetch.tcl: the core ii/IDEC message fetching library and CLI utility
* tiipost.tcl: the core ii/IDEC message posting library and CLI utility
* tiiview.tcl: the CLI viewer of the fetched ii/IDEC messages and conferences
* tiidb: the (overridable) directory that contains all messages and echo lists
* tii.db: the SQLite3 database that contains all messages and echo lists
* config.txt: the set of parameters for all HTTP requests by the tii scripts
* stations.txt: the list of stations to be auto-fetched by tiifetch when none
of its command-line parameters is passed
@@ -28,7 +28,7 @@ Readiness status
* tiifetch.tcl: ready/tested
* tiipost.tcl: ready/tested
* tiiview.tcl: ready/tested
* tiidb (format): ready/tested
* tii.db (format): ready/tested
* config.txt (format/fields): ready/tested
* stations.txt (format): ready/tested
* auth.txt (format): ready/tested
@@ -42,12 +42,12 @@ developed.
### Fetching the messages (tiifetch.tcl): ###
tclsh tiifetch.tcl [station_url] [echos] [dbdir]
tclsh tiifetch.tcl [station_url] [echos] [dbfile]
This command will fetch all messages into the dbdir ("tiidb" in the script dir
by default) from the station_url (can be empty, see below) based on the echo
conference names (can be delimited with slash /, comma (,) or semicolon (;))
and create the corresponding file structure if it's missing.
This command will fetch all messages into the dbfile ("tii.db" in the script
dir by default) from the station_url (can be empty, see below) based on the
echo conference names (can be delimited with slash /, comma (,) or semicolon
(;)) and create the corresponding file structure if it's missing.
Fetching is supported for the following station URL schemes and protocols:
@@ -68,7 +68,7 @@ station to temporarily stop fetching from it by prepending the # sign.
### Viewing the messages from CLI (tiiview.tcl): ###
tclsh tiiview.tcl [echo_name] [filter_string] [line_width] [dbdir]
tclsh tiiview.tcl [echo_name] [filter_string] [line_width] [dbfile]
If the echo_name parameter is passed, this command will write all formatted
messages from the coresponding echo conference to the standard output.
@@ -84,22 +84,20 @@ have no effect at all if you pass it.
If the line_width parameter is omitted, the text reflows to 80 chars per line.
If the dbdir is ommitted, it defaults to "tiidb" in the script directory.
If the dbfile is ommitted, it defaults to "tii.db" in the script directory.
This component is fully offline and can only work with a compatible message
database that tiifetch.tcl can generate (see "Message database format").
database that tiifetch.tcl can generate.
The filter string can take one of the following basic forms:
* h[number]: only take [number] messages from the head (start) of the list
* t[number]: only take [number] messages from the tail (end) of the list
* rh[number]: same as h but output messages from newest to oldest in the list
* rt[number]: same as t but output messages from newest to oldest in the list
* [number]: only take [number] messages from the head (start) of the list
* r[number]: same but output messages from newest to oldest in the list
If [number] is 0 then it means no message limit.
The reverse operation is always done after limiting the results.
e.g. rt50 will output 50 newest messages in the conference, starting from the
e.g. r50 will output 50 newest messages in the conference, starting from the
most recent one. The default basic value is h0, so no filter applied will mean
outputting all messages from the oldest to the newest.
@@ -147,17 +145,6 @@ Any of the fields can be omitted, as well as the file itself.
You can also use torsocks with any script invocation in order to fully cloak
your originating IP address.
Message database format
-----------------------
The tiidb format is based upon the official ii/IDEC developer recommendations
and is fully plaintext-based, portable and very simple:
* Message contents are stored decoded in the "msg/" subdirectory. The file
names are their plain 20-character hash IDs.
* Echo contents are stored in the "echo/" subdirectory. The file names are the
conference names verbatim, containing newline-separated message IDs that
belong to those conferences, in order they were published there.
Every echo file ends with a blank line.
FAQ
---