Visit the “Latest Stories” page. See what’s new. Copy the slug. Go to the collections. Click the right row. Paste the slug. Hit save.

That was the multi-step process of adding a story to the homepage of the LA Times up until a few weeks ago. Now, you just click a button.

New stories automatically drop into our Slack chat channel. They have buttons that list sections of our homepage like the “Head Deck.” Click one, and the story will appear on the homepage moments later. Your action will be logged in the chat.

As an intern at the LA Times Data Desk, I’ve seen the benefits of building tools like this for journalists first hand. From managing copy edits to tracking our coffee, our news nerds constantly look for any way to improve the reporting grind. We’re seated in the middle of the newsroom and collaborate with reporters every day. Many of us even play both roles. Just a week after deploying these Slack buttons, the LA Times published my first byline here, an election map.

The small apps and optimizations we build may not be the overhaul in CMSs that we all want, but they let our editors and reporters focus more on the story and less on copying and pasting. If you follow this guide, you’ll be able to do the same.

Here’s how I made our latest integration, Slack buttons for the homepage team, work.

Managing a homepage is just one use of Slack’s new interactive messages. With that in mind I’ve made this guide to be as language- and task-agnostic as possible. Even though the app we’ll build uses a lightweight Python framework called Flask to manage categories, the programming logic can be easily ported to any language, framework, and task.

Before we get started, there are a few things you’ll need:

Our Homepage Slack bot is integrated with our feed app which fetches stories from our story feeds and posts them into a channel. This can take a number of forms. You could build an RSS parser that connects to your website’s RSS feed with feed parser or a JSON feed. We use hits to our CMS ’s API . That app isn’t part of this guide. You’ll want to add the logic in Sending a Slack Message with Buttons to whatever you create.

parser that connects to your website’s feed with feed parser or a feed. We use hits to our ’s . That app isn’t part of this guide. You’ll want to add the logic in Sending a Slack Message with Buttons to whatever you create. Your CMS will need an API that allows you to manage your stories. If you’re using our company’s Content Services CMS , we have a Python wrapper for you. Other popular CMSs like Wordpress have their own API as well.

will need an that allows you to manage your stories. If you’re using our company’s Content Services , we have a Python wrapper for you. Other popular CMSs like Wordpress have their own as well. You’ll need access to an SSL Enabled server to host your webhook (this is a Slack requirement). Your hosting provider should have settings for enabling SSL . For instructions on how to set up your localhost server on a publicly facing SSL enabled address read our optional guide below.

Setting up Your Slack App

The first thing to set up is your Slack app. Go to the Slack API website to create a new app. Give it a name and choose the team you want to own the app. The name is only for back-end use or distribution—it won’t appear in your Slack channel.

Once your app is built, you’ll have to build a bot for it to interact with your team’s Slack.

Navigate to Bot Users, and click “Add Bot User.” Give your bot a name and click “Add Bot User” again to confirm.

To get the credentials you’ll need, install the app on your team—even if that team is the same as the development team. Navigate to OAuth & Permission and click “Install App to Team.” This will take you through the default Slack authorization screen. That should redirect you to the OAuth screen. Copy the Bot User OAuth Access Token and save it for later.

You’ll also need your Slack app’s verification token to authenticate it.

Navigate to Basic Information, scroll down, and find App Credentials.

Copy your Verification Token and save it for later, too.

Finally, it’s time to set up the webook. Navigate to Interactive Messages under Features and turn them on. Fill in the Request URL with the SSL Enabled Webhook address, which we’ll set up later. Keep in mind that this webhook will be used for all the interactions associated with this app. If you want more than one action, you’ll have to handle that on one webhook. More on that later.

Setting up the Example Repo

To follow along with this guide, download this repo and follow the installation instructions.

After installing the app open up app.py in a text editor to fill in your Slack App’s information.

Here you can change the display name and icon for your Slack posts. Our test app uses the following information:

SLACK_BOT_TOKEN = '[BOT_TOKEN]' SLACK_VERIFICATION_TOKEN = '[VERIFICATION_TOKEN]' SLACK_CHANNEL = '[CHANNEL]' SLACK_USERNAME = '[BOT_USERNAME]' SLACK_ICON = '[BOT_PROFILE_IMAGE_URL]'

Next, set up the button layout. Each button should be a dictionary with a name , display , and value .