David DePiano
Strava, Slack, & WordPress Integration

Strava, Slack, & WordPress Integration

A few years ago, I started working for a company called Dyn. There were a number of us who met every few days to go out for a run. In 2011 there were no more than 5 or 6 of us who ran at lunch. As the company grew, we were looking for ways to entice employees to remain active and fit. Part of this was a genuine belief that healthy people cost the company less in health care premiums, sick time, and had increased productivity.

There were a variety of efforts to try to track employee workouts and reward them for staying active. Then, one day the company subscribed to Slack as it’s corporate messaging platform. As a Strava user, I got to thinking, “Wouldn’t it be cool if employees not only created a Strava ‘club’ but have all activities post into a Slack channel to not only brag about what we did, but motivate each other and give kudos?”

Incidentally, I was also looking for a way to post my workouts easily on this website. I found a developer who created a WordPress plugin but quickly realized that his code was limited. It only worked for rides. I wanted the ability to post rides, runs, swims, walks, hikes, etc.

Looking at both of my projects (Slack and WordPress) I decided to re-write the developers code. I added additional conversions, ability to post PRs to WordPress, and expanded the code to allow for a significantly larger amount of Strava supported activities. The Strava plugin has since been decommissioned.

WordPress Plugin

As noted above, I re-wrote the WordPress plugin. Integrating with a post is simple. All one needs to do is enter a WordPress shortcode (with no spaces) such as:

[ strava id="684814915" ]

I added several items including a map (if it was part of the activity, tags for Strava “best efforts”, and several conversions for minutes per mile, pace per 100 yards, miles per hour, elevation etc. Overall this is really helpful for when I write race reports. An example of what this looks like is below.

  • Ride Name:
  • Distance: 0 mi
  • Elevation Gain: 0 ft
  • Moving Time: 19:57:25
  • Location: