DEV Community

Cover image for PublishTo.Dev: Scheduling article publishing on dev.to
Todd Anglin
Todd Anglin

Posted on

PublishTo.Dev: Scheduling article publishing on dev.to

It's 11 PM.

You've finally put the finishing touches on your next masterpiece article on dev.to. You can't wait to share it with the world and start collecting those ❤️ and 🦄.

You move your cursor to that 'Publish' button, but then pause...

Should you publish the article now and risk getting buried in the morning's headlines? Should you set an alarm and try to remember to return to your draft and click 'Publish' at the right moment?

It's a conundrum and it's too late to think this hard.

I have a solution: PublishTo.Dev. A simple tool for dev.to authors that lets you choose the exact date and time you want your draft article to go live. Just choose a time, schedule your article, and go to bed knowing your content will land at the perfect time.

What is PublishTo.Dev?

At its core, PublishTo.Dev is a scheduling service for dev.to authors. It uses the recently introduced dev.to API to publish draft articles on a specific date and time. Well, I'll let this video explain.

There are 3 primary components of this service:

  1. A browser extension used for scheduling articles
  2. An Azure serverless backend that handles the scheduling
  3. A static site to review/cancel scheduled postings

The browser extension works with both Google Chrome and Microsoft Edge Insider. The extension can be installed directly from the Chrome Web Store (and eventually Microsoft Edge Extension store), OR loaded "unpacked" from the GitHub source.

PublishTo.Dev does not attempt to change the article authoring experience. It works on saved, unpublished drafts that have already been authored using existing tools. PublishTo.Dev is focused exclusively on scheduling articles.

The scheduling process

Let's take a look at how you schedule a draft article using PublishTo.Dev.

Setup

First, you need to install the browser extension. Follow the instructions in the GitHub repo or (if you're using Chrome) just install from the Store.

With the extension installed, there is a one-time configuration step to add your unique dev.to API access token. This is how PublishTo.Dev publishes on your behalf. Right-click on the extension icon in the browser and choose 'Options'. Alternatively, you can navigate to chrome://extensions or edge://extensions to get to the options page, too.

Here, you are asked for your API access token.

To get that, navigate to the settings account page on dev.to and generate a new token for PublishTo.Dev. Copy the token value and it to the extension options.

Scheduling

Now that you're all set up, let's schedule an article.

Navigate to a saved draft. You know you're on the right page when you see the big, red "Unpublished" banner at the top of your article. From here, click the browser extension icon and choose the date and time you want the article to go live.

Note: The selected publishing time must be in the future (obviously), up to 30 days from now. That is an arbitrary limit that may be removed in the future, but for now, articles can be scheduled up to a month in advance. When choosing a time, specific hours or minutes can be directly input in the calendar text boxes.

With your date and time selected, click "Schedule Post."

If all goes well, you'll see a confirmation message in the extension pop-up.

Rescheduling

Oops! You just remembered that Wednesdays are better for your content than Mondays. How do you change your publishing schedule?

Simple. Just revisit the unpublished draft that needs to be rescheduled, and follow the original process. As long as the article has not yet been published, the new scheduled time will override the previous schedule.

Reviewing and Cancelling Schedules

While the browser extension is used for all article scheduling, a separate website is available for reviewing the status of scheduled articles.

To use the website, simply enter the same dev.to API access token configured with your browser extension and click "Get Scheduled Posts."

If you have scheduled articles, they will be displayed along with one of the following status indicators:

  • Published: Successfully published scheduled article
  • Pending: Article waiting to publish at scheduled time
  • Failed: Something went wrong and the article did not publish at scheduled time
  • Cancelled: Scheduled publishing was cancelled by the author (you)

Any article in the Pending state can be cancelled if you no longer want it to be published automatically. Just click the "Cancel" button on the row for that post.

If you decide to reschedule a Cancelled post in the future, just follow the original scheduling process and the article will be rescheduled. The only state that is "final" is Published. A published post cannot be republished or unpublished using PublishTo.Dev.

How does this work?

Behind the scenes, the heavy lifting for PublishTo.Dev is made possible by Azure Durable Functions. Durable Functions are perfectly suited for dealing with long-running, async tasks, only actively running (and billing) when something needs to be done between periods of waiting. The wait could be seconds, minutes, hours, days...or longer*.

(*Durable function timers cannot last longer than 7 days today, BUT...that is a limit that's being removed AND there are workarounds today for setting longer timers. I'll get in to that in another post.)

In the case of PublishTo.Dev, a serverless function runs when an article is initially scheduled, and then using a durable function timer, "hibernates" until it's time to publish the post. This eliminates the need to do any kind of interval polling to know when a post needs to be published.

When the scheduled publish time arrives, the durable function automatically wakes up and tries to publish the post using the dev.to API.

Durable functions are good for many different kinds of long-running, async scenarios. In fact, the docs highlight six common scenarios, like chaining async functions or even waiting on human input, where durable functions make your life much easier.

In future articles, I will expand on the technical implementation of PublishTo.Dev. Stay tuned for that.

Putting it all together

From the outset, the goal was to provide an easy way to schedule post publishing, and PublishTo.Dev accomplishes that. Or, it does for me.

Let me know what you think. How does it work for you? How can it be a more useful utility?

One day, I fully expect dev.to will support native post scheduling and eliminate the need for this tool, but until then, I hope it helps you improve your publishing workflow.

Top comments (36)

Collapse
 
lostdesign profile image
André

Nicely done, now I just neeed to write enough articles so that I am actually in need of this.

Collapse
 
allanjeremy profile image
Allan N Jeremy

😂 relateable

Collapse
 
matthew_collison profile image
Matthew Collison

Can we buy you Reddit gold or is that not how this works??? 😂 Great job! We will definitely be using this. Thank you for this awesome tool

Collapse
 
simme profile image
Simme

This is great! Good job!

I'm a little concerned regarding security though as the api key seems to be stored in clear-text in the db currently. This seems like a huge attack vector for malicious users as dumping that table would mean you get programmatic access to all user accounts.

Collapse
 
muhimen123 profile image
Muhimen

Not all, those who have signed in. You can always use the dev API on your own. That's what I prefer.

Collapse
 
andy4thehuynh profile image
Andy Huynh

I notice my favorite newsletters like MorningBrew and the Daily Stoic deliver emails before I wake up on the west coast (PST). 3am... 5am... they have a huge following so they must've discovered something.

Collapse
 
simbo1905 profile image
Simon Massey

Awesome! ... so what is a good or bad time to publish? Are there some stats anywhere about activity on dev.to or should I just use some guesswork?

Collapse
 
zimski profile image
CHADDA Chakib

I like the code, the tool & the spirit !

Great job man ! Keep going :)

Collapse
 
5422m4n profile image
Sven Kanoldt

Nice! Now we just need a publish broadcast service that publishes on Dev, Twitter, medium, HN, and so on.

Collapse
 
brunner1000 profile image
Brunner

tried building that, but was wondering if it would be useful enough.
Or if people will not find it boring to see the same article everywhere they go
What do you think?

Collapse
 
5422m4n profile image
Sven Kanoldt

If you check the feedback here, I'm quite sure some will find value in it.

Collapse
 
digitalix profile image
Alex Ziskind

Awesome post - thanks for sharing! I want that voiceover guy for my courses :)

Collapse
 
idrisrampurawala profile image
Idris Rampurawala

Killer feature bro! Can't wait to try it out :)

Collapse
 
andy profile image
Andy Zhao (he/him)

Wow this is awesome! Thanks for making it!!

Collapse
 
oscherler profile image
Olivier “Ölbaum” Scherler

The real question is: will it result in fewer occurrences of many articles by the same person following each other and hogging my home page feed, or even more of those?

Collapse
 
grazhevskaja profile image
Alexandra Grazhevskaja

This tool looks really useful and cool, I will try to use it.
Thank you for contributing!!

Collapse
 
john_papa profile image
John Papa

Nice job! Really helpful, thank you

Collapse
 
seangwright profile image
Sean G. Wright

Nice work! I look forward to checking this out.

Thanks! 🙏

Collapse
 
allanjeremy profile image
Allan N Jeremy

This is a true unicorn! Part of the reason I keep "not publishing " is because of timing andscheduling.

Thanks a bunch Todd!!