Slack Liveblog is a WordPress plugin designed to bridge the gap between your WordPress website and your Slack workspace. The plugin allows you to establish a seamless connection between a specific WordPress post or page and a corresponding Slack channel, ensuring that every message, update, or edit made in the channel is synced in real-time to the WordPress post.
- New messages
- Editing messages
- Deleting messages
- Fetching images
- Fetching social media embedded elements (X, Mastodon, YouTube)
- Threads
- Reactions
- Users avatars
Tested on | Version |
---|---|
PHP | 7.4.x |
MySQL | > 5.7.x |
Wordpress | > 5.7.x |
To create a new channel and link it to the Slack Liveblog, follow these steps:
- Navigate to
wp-admin/admin.php?page=slack_liveblog_settings
. - Connect a new Slack workspace.
- Navigate to
wp-admin/admin.php?page=slack_liveblog_channels
. - Enter the
Slack member ID
for the person you wish to invite to the new channel. For instructions on how to find this ID, see https://moshfeu.medium.com/how-to-find-my-member-id-in-slack-workspace-d4bba942e38c. - Enter a name for the new channel. Channel names can include lowercase letters, non-Latin characters, numbers, and hyphens, and must be unique in your workspace. There is a 21 character limit.
- Click
Generate new channel
. - The new channel will now appear in your workspace.
- The person you specified in
step 2
will receive an invitation to the new channel. - Copy the shortcode from the list (it will look something like this:
[slack_liveblog channel_id="XXXXXXXX"/]
). - Paste the shortcode on any post or page where you want the liveblog to appear.
- Return to Slack, invite other users to the channel and start liveblogging.
Note that you can choose to close the channel to new updates at any time by closing it from the list of channels.
cd wp-content/plugins
git clone git@github.com:berkmancenter/slack-liveblog.git
Install the plugin and you are set to use it.
You will need:
- composer
- node >= 14.x
- yarn or npm
cd wp-content/plugins
git clone git@github.com:berkmancenter/slack-liveblog.git
cd slack-liveblog
composer install
cp .env.example .env
./build_assets.sh
cd front
yarn install
yarn run build --watch
The front-end Vue application will rebuild automatically after every code change.
- To print Slack events to the standard output, simply set the
SLACK_LIVEBLOG_DEBUG
environment variable totrue
. This will provide you with valuable insights and help you troubleshoot any issues that may arise. - For multisite setups, add
--url=example.com
to./vendor/bin/wp migrations migrate --setup
and./vendor/bin/wp migrations migrate
. Replaceexample.com
with your site's URL.
Set these environment variables prior to running the WebSocket server.
Name | Description | Default | Required |
---|---|---|---|
SLACK_LIVEBLOG_USE_WEBSOCKETS |
Tells the plugin to use the WebSocket server | false | Yes |
SLACK_LIVEBLOG_WS_SERVER_CLIENT_URL |
URL that clients will connect to the WebSocket server | Yes | |
SLACK_LIVEBLOG_WS_SERVER_HOST |
Host part of the SLACK_LIVEBLOG_WS_SERVER_CLIENT_URL |
Yes | |
SLACK_LIVEBLOG_WS_SERVER_PORT |
Custom WebSocket server port | 8080 | No |
During development, you can initiate the server on port 8080
by executing the command:
php classes/WebsocketServer.php
Consider using https://github.com/foreversd/forever or a similar app for optimal production performance.
Copyright (c) 2021 President and Fellows of Harvard College