Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 30, 2019 02:35 pm GMT

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.


Original Link: https://dev.to/toddanglin/publishto-dev-scheduling-article-publishing-on-dev-to-3m0o

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To