ubuntu-bots/Encyclopedia
Krytarik Raido 182cc59009 Bugtracker: Various improvements.
* Add option to set aliases on trackers.
* Complete removal and renaming of trackers.
* Only load default trackers if none set yet.
* Improve handling of auto-discovered trackers.
* Add function to reset trackers to defaults.
* Minor fix to Encyclopedia along the way.
2019-07-08 02:45:04 +02:00
..
README.txt Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00
__init__.py Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00
config.py Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00
factoids.cgi Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00
factoids.tmpl Encyclopedia: General overhaul. 2018-05-22 00:45:04 +02:00
plugin.py Bugtracker: Various improvements. 2019-07-08 02:45:04 +02:00
sqlite2to3.py Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00
test.py Encyclopedia: Restructure databases. 2018-05-22 00:45:04 +02:00

Factoid plugin
Note: This plugin used to have package lookup, this was moved to the
PackageInfo plugin.

Pick a name for your database. A lowercase-only name without spaces is probably
best, this example will use myfactoids as name. Then create a directory to store
your databases in (somewhere in $botdir/data would be best).
If you choose to enable this plugin during supybot-wizard, the database will be
created for you. If not, you can create the database manually.
In the new directory create an SQLite 3 database with the following command:

sqlite3 myfactoids.db

Then copy/paste in the below 3 tables:

CREATE TABLE facts (
    id INTEGER PRIMARY KEY,
    name TEXT NOT NULL,
    value TEXT NOT NULL,
    author TEXT NOT NULL,
    added TEXT NOT NULL,
    editor TEXT,
    edited TEXT,
    popularity INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE log (
    id INTEGER PRIMARY KEY,
    type TEXT NOT NULL,
    name TEXT NOT NULL,
    value TEXT NOT NULL,
    author TEXT NOT NULL,
    added TEXT NOT NULL
);

CREATE TABLE requests (
    id INTEGER PRIMARY KEY,
    type TEXT NOT NULL,
    name TEXT NOT NULL,
    value TEXT NOT NULL,
    requester TEXT NOT NULL,
    requested TEXT NOT NULL
);

If you want to create more databases, repeat these last two steps.

When the databases exist, you need to configure the bots to actually use them.
To do that, set the global value supybot.plugins.encyclopedia.datadir to the new
directory and the channel value supybot.plugins.encyclopedia.database to the name
of the database (without the .db suffix).

Documentation on adding/editing factoids can be found on
https://ubottu.com/devel/wiki/Plugins#Encyclopedia

To give people edit access, let them register with your bot and use the command:
@addeditor nickname_here
(replace @ with your prefix char). Similarly you can use removeeditor :).

The web interface is a simple cgi script with some templates, css and the
commoncgi.py file from the bzr tree. Make sure you set the variables datadir and
database in factoids.cgi to the correct values. Also set default_db to the one
you want to show by default.