Ultimate Guide: Automating Medium to Twitter

Microsoft Flow

Top writers always give the same advice that goes something like this:

Half the time you should be writing; the other half is marketing.

No one is going to magically find your content. You need to go where people are.

But why should marketing take half your time? Get it off your plate so you can focus on the more creative processes. I know what you’re thinking…

“It takes two minutes to post a Tweet. Why automate it?”

Automatically posting a tweet when you publish a story is a gateway drug. Once you get the hang of it, you can do a ton! Here’s a short list of my favorites:

  1. Post to Twitter, LinkedIn, Facebook, Tumblr, Instagram, Pinterest, Reddit, etc.
  2. Automatically create tasks in Microsoft To-Do, Todoist, OneNote, Asana, Basecamp, etc.
  3. Automatically chart your social media growth to Excel spreadsheets.
  4. Track your post-click-through rate by adding Bitly.
  5. Automatically gather top influencers in your niche from social media.

The list goes on and on and on. In short, you can get more data, cut time to market, and be more productive.

By using Microsoft Flow, we can automate posts from Medium (or any RSS feed) to be shared across multiple social media platforms leaving you more time to write. Why Microsoft Flow?

Microsoft Flow is the most powerful (and FREE) codeless automation toolset on the market. With complex workflows, you can make powerful apps to streamline your social media process. But there’s a cost to this power.

This power comes with one major drawback: It’s complex. Getting started with Microsoft Flow isn’t as easy as IFTTT or Zapier. To truly harness Flow’s full potential we’ll need to tap into some core programming concepts. But don’t worry, we’ll walk through everything you need to automate the process.

How to Get Microsoft Flow

Microsoft has a free option; you can go to https://flow.microsoft.com and sign up to get started. Go and sign up now.

For everyone using Microsoft Office 365, you probably already have Flow; it’s integrated directly into Office 365. Go to https://flow.microsoft.com and log in with your Office 365 credentials.

Navigating Microsoft Flow

Microsoft Flow Navigation
Microsoft Flow Navigation

Microsoft updated Flow’s interface recently. They’ve put most of the navigation down the left-hand side to make it easier to navigate the app.

  • Home: Explore a diverse set of templates and learn about the key features for Microsoft Flow. You can get a quick sense of what’s possible and how Microsoft Flow could help your business and your life.
  • Approvals: Manage the approval of documents or processes across several services, including SharePoint, Dynamics CRM, Salesforce, OneDrive for Business, Zendesk, or WordPress.
  • My Flows: Create a flow that performs one or more tasks automatically after it’s triggered by an event. For example, create a flow that posts to LinkedIn after an article is published on Medium.
  • Templates: Microsoft and other third parties have created commonly used flows. You can select a template and create a workflow in minutes.
  • Connectors: Apps that you have connected and given Microsoft Flow access to. Example: a connector to your account on Twitter.

Posting a Medium Article to Twitter

First, we’re going to make a simple workflow that will automatically post a message to Twitter when there’s a new post by a Medium author. Before we dive into the step-by-step guide, let’s take a bird’s eye view of the entire process.

The first thing to note: websites are designed for you and me. They aren’t easy for computers to understand. What you may not know is every time an article is published on Medium, the document is also shared using a global standard, a standard that computers can read: RSS. In short, RSS uses a more computer-friendly version of the article. Don’t worry. What we’ll do is simple.

  1. We’ll create a workflow that will automatically run every time you publish an article.
  2. Then, we’ll take some information from the article to compose a tweet.
  3. Finally, we’ll post the message to Twitter.

Let’s jump in and make it happen.

Create a New Flow

The first thing we need to do is create our workflow. The workflow contains all the logic we need in a nice little container.

  1. Log on to https://flow.microsoft.com.
  2. Click My flows in the left navigation.
  3. Click New in the command bar.
  4. Click Automated-from blank in the drop down.
  5. Set the Flow name to Medium to Social Media
  6. Type RSS in the Choose your flow’s trigger.
  7. Click When a feed item is published.
  8. Click Create.
Microsoft Flow new flow from Blank
Microsoft Flow name your new flow

In short, we’ve just created a workflow that will run every time a new article is published. Once complete, Microsoft will automatically take you to the workflow management page. Stick it out. You’re basically halfway there.

Tell Flow What to Watch

At this point, your workflow knows to start when a new article is published, but it doesn’t know what RSS feed to watch. So we’ll need to tell your workflow where your RSS feed is. Don’t worry, it’s simple.

Each Medium user has its own RSS feed with a URL similar to

https://medium.com/feed/@gruberjl

To get your RSS feed URL, replace ‘gruberjl’ with your Medium username.

Enter your URL into the text box labeled The RSS feed URL.

Microsoft Flow > When a feed item is published

Boom. Your workflow now knows where to find you.

Add an Action to Your Workflow

At this point, we’ve configured a Flow that will run every time you post a new article to Medium. But a Flow with only a trigger doesn’t actually do anything.

We’ll need to add an action. Essentially, we’re telling Microsoft Flow what to do when you write a new article on Medium.

  1. Click New step.
  2. In the Search connectors and actions text box, enter Twitter.
  3. Click Post a tweet.
Microsoft Flow New step
Microsoft Flow Post a tweet

Connect Your Twitter Account to Your Workflow

After you add the Twitter action, you’ll see a big Sign In button. At this point, your workflow knows you want to post a message to Twitter after you publish an article, but it doesn’t know what account to publish it under.

  1. Click Sign in. A new browser window will open.
  2. Enter your Twitter login information and click Authorize app.
Microsoft Flow sign in to Twitter
Microsoft Flow sign in to Twitter and authorize app

Once the sign in is complete, the new window will close, and your workflow will know what Twitter account you’re using.

Configure the Twitter Action

Now our Flow needs to know what the Twitter post should say.

At this point, you may be wondering how we’ll get the URL and other information automatically each time we post an article. Fortunately, the initial trigger we created “When a feed item is published” does two things.

First, it starts the Flow.

Second, it gathers information about the article and delivers the information to the Flow. Instead of manually entering a URL in the Content URL field, we’ll use the information that your Flow is already aware of.

  1. Click the Tweet text text box.
  2. Click Feed title, then press enter.
  3. Click Feed links Item, then press enter.

You’ll notice Microsoft Flow will automatically add “Apply to each” to your workflow. That’s normal. In short, Microsoft Flow is automatically setting up your workflow for you!

Microsoft Flow Post a tweet from RSS

Now we’re going to add tags which is the hardest part. Don’t worry; you got this!

Add Tags to Your Post

The tags will be imported from Medium into our Flow, but they come in as a list of strings. We need to convert our list to hashtags.

To visualize this point, we need to take the Medium tags that look like this:

  • Office 365
  • Email
  • Security

And convert it to “#Office365 #Email #Security”.

To do this, we’ll need to add an action directly under the When a feed item is published trigger. This is a special action that doesn’t interact with the outside world. We’ll create a variable, which, in our case, is the hashtag text that we can use later in our workflow.

To add an action in between two existing steps

  1. Hover the mouse on the down arrow
  2. Click the plus sign +
  3. Click Add an action.
Microsoft Flow Apply to each
Microsoft Flow add an action

Just like before, your workflow needs to be told what you’re adding.

  1. Type initialize variable into the Search connectors and actions text box.
  2. Click Initialize variable.
Microsoft Flow initialize variable
  1. Enter Hashtags in the Name field.
  2. Select String in the Type field.
  3. Left mouse click the Value text box, giving it the focus.
  4. Click Expression.
  5. Copy and paste the following text in the Fx box and click OK.
replace(replace(join(triggerBody()?['categories'], '~#'), ' ', ''), '~', ' ')
Microsoft Flow initialize variable expression

Now we have our hashtags, sort of. We have a string that will look something like this “Office 365 #Email #Security.” We’re missing the first hashtag, and we need to tell the workflow to add the hashtags to our tweet.

  1. Click Apply to each to open the action.
  2. Click the empty line in your tweet text text box.
  3. Type #.
  4. Click Hashtags.
Microsoft Flow Post a tweet dynamic content

Bam! You’re done. All we need to do now is save and test.

Save and Test

  1. Click Save in the top right corner so you don’t lose your work.

Write an article on Medium, and be sure to give it a title, featured image, and tags.

The flow will run within 15 minutes and post to Twitter!

Microsoft Flow Tweet posted

After you verify it’s working, delete the Tweet and the Medium article!

Congrats, you’re a codeless programmer! See if you can add LinkedIn or Facebook to your workflow on your own.

Any questions, please post in the comments below. I’d be happy to assist.

References

  1. Microsoft Flow Sign up.
  2. IFTTT
  3. Zapier