How to automatically post from Gatsby to Medium and dev.to
Published: 2021-01-23 23:10:54

---
title: How to automatically post from Gatsby to Medium and dev.to
published: true
date: 2019-11-06 00:00:00 UTC
tags: 
canonical_url: https://www.mariokandut.com/how-to-automatically-post-from-gatsby-to-medium-and-dev-to/
---

A professor at university once said to me:

> If he has to decide on hiring a lazy student or a top-notch student, assuming both get the same work in the same time done. He would always choose the lazy person, because the lazy student is more efficient.

After all these years I'd say **don't be lazy, be smart**. Automation can help you get the job done quicker and saves you time, which you can spend on the things you love. Maybe more coding? 😂

### [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#the-three-steps-plan)The three steps plan

I assume you know your way around npm, Gatsby and javascript. This is what we are going to do:

1. Setup an RSS feed in Gatsby
2. Create a zap RSS to Medium
3. Configure RSS income stream in dev.to

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#1-setup-an-rss-feed-in-gatsby)1. Setup an RSS feed in Gatsby

For creating an RSS feed in Gatsby, please refer to this post. [How to setup an RSS feed in Gatsby](https://www.mariokandut.com/how-to-setup-an-rss-feed-in-gatsby/)

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#2-create-a-zap)2. Create a zap

Zapier provides workflows to automate the use of web applications together. It is often described as a translator between web APIs. [see wikipedia](https://en.wikipedia.org/wiki/Zapier)

So headover to [zapier.com](https://www.zapier.com) and create an account. I would recommend setting up Two-Factor-Authentification.

When you have confirmed your email and you've logged in into zapier, you see a red button **MAKE A ZAP**. Click it!

Our automation should do this. **Create a new medium post** if a **new item** is in our **RSS feed**.

Choose the app **RSS by Zapier**.

![Zapier Choose the App](https://www.mariokandut.com/static/dcd139b575e03307111a3957278a7abe/fcda8/zap-1.png "Zapier Choose the App")

Choose the trigger event.

![Zapier Trigger Event](https://www.mariokandut.com/static/d1a016c23c2cac2f64b13481c9aedbc1/fcda8/zap-2.png "Zapier Trigger Event")

Now add the Feed URL. ![Zapier Feed Url](https://www.mariokandut.com/static/315d834b2350e04e9bb4ea30b3e9acf0/fcda8/zap-3.png "Zapier Feed Url")

Click continue and check if it works with clicking on **Test & Review**. ![Zapier RSS data check](https://www.mariokandut.com/static/94245130dfcb0151f056514569e11f93/fcda8/zap-4.png "Zapier RSS data check")

I have two items in my RSS feed, so I choose one for further testing and click **Done editing**. ![Zapier RSS data](https://www.mariokandut.com/static/f58de0669a57995d0748c46535a1bc90/fcda8/zap-5.png "Zapier RSS data")

50% done. YAY. Now we have to setup the **Do this...** part. ![Zapier App](https://www.mariokandut.com/static/7bd80619f66b7625b9b37983c8fd8b60/fcda8/zap-6.png "Zapier App")

Choose the app **MEDIUM** and choose the action event **CREATE STORY** and click continue. ![Zapier Medium App](https://www.mariokandut.com/static/bd48b007ca4911d95f8a3e4b668e8637/fcda8/zap-7.png "Zapier Medium App")

Now choose the medium account you want to connect. If your account, doesn't appear you have to connect your medium account to your zapier account. [Here](https://zapier.com/apps/medium/integrations) are more details on this.

![Zapier Medium Account](https://www.mariokandut.com/static/e1cec859c0b2fdf944d72f275d54da8b/fcda8/zap-8.png "Zapier Medium Account")

Now, let's customize our story for medium. You should see a form like this: ![Zapier Custom Story form](https://www.mariokandut.com/static/ecbdc5c93997973ff4762ee144255438/fcda8/zap-9.png "Zapier Custom Story form")

All fields marked required, need to be filled in.

- For the **title** , choose the post title.
- **Format** should be post HTML.
- The **content** filed should be the **Raw\_Encoded** post content. As the first line I am adding this, which links to the original post published on my blog and says it's a crossposting. `<p>This story was originally published ...</p>`.
- **subtitle** is optional, I use my description field.
- **tags** field is optional, I use my custom tags field.

**IMPORTANT:** for SEO purposes the original source of this content needs to be marked with a canonical tag. Otherwise, you have duplicate content and this could result in a search penalty.

- **canonical url** is optional, but we don't want to create duplicate content, so put the post url in.
- **publish status** is also optional, but I want it to go live automatically.

![Zapier Custom Story](https://www.mariokandut.com/static/02b88054763099dedd33e0654283d117/fcda8/zap-10.png "Zapier Custom Story")

Now, click Retest & Review and your post should get send to medium. ![Zapier Medium Data Check](https://www.mariokandut.com/static/29e43a473fee8d45950367317a0b1014/fcda8/zap-11.png "Zapier Medium Data Check")

Log into medium and verify. And **DONE**! YAY. 👍 ![Medium Stories Overview](https://www.mariokandut.com/static/52ba0d85d39c1809d7dcc27ddf19c8fa/fcda8/zap-12.png "Medium Stories Overview")

## [<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#3-configure-rss-income-stream-in-devto)3. Configure RSS income stream in dev.to

[dev.to](https://www.dev.to) is an amazing developer community, if you haven't joined yet, do it now and check it out.

To add your RSS Feed to dev.to simply go to [settings](https://dev.to/settings) and click [publishing from RSS](https://dev.to/settings/publishing-from-rss). Then **add your rss feed** and click **update**. ![Import RSS Feed into dev.to](https://www.mariokandut.com/static/f1c6413cb1529286f2b2d1e98bed8c7c/fcda8/devto-rss.png "Import RSS Feed into dev.to")

**IMPORTANT:** The synced posts will be in your dashboards as drafts, so you can double check them. If you want fully auto-posting contact the admins and give them the right to set your posts to public. (send an email to [yo@dev.to](mailto:yo@dev.to)).

Hope you managed to automate your posts. If you have any questions, use the comment function or send me a message on twitter [@mariokandut](https://www.twitter.com/mariokandut).