A tool for publicly archiving and displaying Zulip chat channels.
Author: Robert Y. Lewis (@robertylewis)
The script archive.py
has two functions:
- It builds a json archive of messages from a Zulip chat room.
- It generates static markdown/html to display these messages.
This is particularly useful when used in combination with Jekyll, to compile the html/markdown to a functional website. An example of this can be seen at the leanprover-community Zulip chat archive.
This script is provided as-is. Contributions to make it more robust or more general are very welcome.
-
The script requires Python 3.
-
Install the Zulip python bindings, with
pip3 install zulip
. -
Create a bot and download its zuliprc file to
zulip_archive/zuliprc
within this project. -
Extend the
zuliprc
file with anarchive
section like this:[archive] root_url=file:///home/tabbott/zulip_archive # A whitelist of streams; if specified, only these streams will be included. stream_whitelist=announce # A blacklist of streams; these streams will never be included. stream_blacklist=hidden, other hidden
-
Optionally, modify the display generation code to fit your needs. The defaults are based on the leanprover-community Jekyll setup.
-
Run
python3 archive.py
with the following options:-t
builds a fresh archive. This will download every message from the Zulip chat and might take a long time. Must be run at least once before using-i
.-i
updates the archives with messages posted since the last scrape.-b
generates the markdown/html output.-f
updates the git repository containing the script, and-p
pushes the generated files. Useful if the script is generating a static site hosted using GitHub Pages.