Source code for the PTG event scheduling bot
Go to file
Thierry Carrez 0084e17e31 Fix bot name in rendered page
The bot runs as openstackptg, not ptgbot. Spare some confusion.

Change-Id: Ifc9ca600466be096e14dadeb8ab19acd7bc3025a
2017-08-04 15:56:25 +02:00
html Fix bot name in rendered page 2017-08-04 15:56:25 +02:00
ptgbot Move admin commands from ! to ~ 2017-08-04 15:53:45 +02:00
.gitignore Add basic HTML output system 2017-04-20 18:00:26 +02:00
.gitreview Fix .gitreview to match code repository 2017-06-13 11:40:47 +02:00
config.json.sample Facilitate Ethercalc cells specification 2017-06-29 16:46:16 +02:00
LICENSE Initial commit 2017-04-18 14:21:26 +02:00
README.rst Move admin commands from ! to ~ 2017-08-04 15:53:45 +02:00
requirements.txt List requests as a requirement 2017-07-12 22:48:13 +00:00
setup.cfg Initial commit 2017-04-18 14:21:26 +02:00
setup.py Initial commit 2017-04-18 14:21:26 +02:00
test-requirements.txt Initial commit 2017-04-18 14:21:26 +02:00
tox.ini Initial commit 2017-04-18 14:21:26 +02:00

OpenStack PTG Bot

ptgbot is the bot that PTG room moderators use to surface what's currently happening at the event. Room operators send messages to the bot, like:

#swift now discussing ring balancing

and from that information the bot builds a static webpage with discussion topics currently discussed ("now") and an indicative set of discussion topics coming up next ("next"). It also merges information from the reservable rooms ethercalc in order to produce a single, static, mobile-friendly page.

Room operators commands

You have to have voice in the channel (+v) to send commands to the ptgbot. Commands follow the following format:

#ROOMNAME [now|next] TOPIC

Please note that:

  • There can only be one "now" topic at a time. If multiple topics are discussed at the same time in various corners of the room, they should all be specified in a single "now" command.
  • In order to ensure that information is current, entering a "now" command wipes out any "next" entry for the same room. You might want to refresh those after entering a "now" topic.

Example:

#swift now discussing ring placement
#swift next at 2pm we plan to discuss #glance support
#swift next around 3pm we plan to cover cold storage features
...
#swift now discussing #glance support, come over!
#swift next at 3pm we plan to cover cold storage features

Admin commands

You have to ve a channel operator (+o) to use admin commands.

~list

List available room names

~add ROOM [ROOM..]

Add new room name(s)

~del ROOM [ROOM..]

Deletes room name(s)

~clean ROOM [ROOM..]

Removes active entries for specified room(s)

~wipe

Resets the database entirely (removes all defined rooms and entries)

Local testing

Copy config.json.sample to config.json:

cp config.json.sample config.json

Edit config.json contents, for example:

{
"irc_nick": "ptgbot",
"irc_server": "irc.freenode.net",
"irc_port": 6667,
"irc_channel": "#testptg",
"db_filename": "html/ptg.json",
}

In one terminal, run the bot:

tox -evenv -- ptgbot -d config.json

Join that channel and give a command to the bot:

#swift now discussing ring placement

(note, the bot currently only takes commands from Freenode identified users)

In another terminal, start the webserver:

cd html && python -m SimpleHTTPServer

Open the web page in a web browser: http://127.0.0.1:8000/ptg.html