Taro: Making Cron Jobs Fun Again

Alex Reichert
3 min readMay 31, 2020

--

This past week we built Taro, a web application that makes it super easy to deploy and monitor simple recurring jobs.

Try it out, and let us know what you think! https://www.gettaro.com/

🚀 [Update June 9] We recently added a Slack integration! Learn more about it here: https://medium.com/@reichertjalex/taro-integrating-with-slack-868df7f7b3aa

Background

Why is this useful, anyway?

As developers, every now and then we come up with cool ideas of things to automate. I remember when I first started coding and was looking for an apartment in San Francisco, I felt like the world’s cleverest hacker when I set up a script to email every new listing on CraigsList in the neighborhoods I was interested in living in. (This had some disastrous consequences, but that’s a story for another time.)

My only problem at the time was that I would have to manually run this script myself every day.

Now, as a more experienced developer, I know enough to know that one approach to this problem is to set up a cron job, or something similar. Recently I found myself wanting to do this again… but every time I want to do it, it takes some effort to remind myself how it all works. At first I thought, maybe I’m just an idiot. But after talking to a few friends, we realized that a bunch of us have the exact same issue.

So we figured, why not build a little tool that makes this process extremely simple? This is what led to the creation of Taro :)

Code examples

So let’s get right to it — what are some simple tasks we can set up and schedule using Taro?

(Note: you should be able to copy/paste all the examples below into Taro’s code editor and run them. You can also find a full list of this in Github here. Please let me know if anything is broken!)

Pinging your server

Often the simplest form of monitoring your app is to just ping your server every 10 minutes or so. There are several services out there that handle this already (e.g. uptimerobot.com), but it’s just as easy (if not easier!) to do this with Taro.

A daily email with an inspirational quote

This script simply makes a request to an API with a long list of inspirational quotes and picks one out at random for the output. With Taro, you can easily hook this up to our email service to send the generated quote in an email to yourself every morning.

Check if a product is in stock

The simplicity of this script may vary depending on the website you want to check, but in this case, all we had to do was check the HTML for the case-insensitive string: out of stock. Our friend used this script to notify himself over text message once the item was back in stock.

Scrape top posts from Hacker News

This script introduces a little bit more complexity, now that we’re parsing some HTML with the cheerio library. But this allows us to get all posts with a score over a certain threshold, and send ourselves updates (e.g. over Slack) of interesting articles however often we’d like.

Weekly newsletter from your favorite subreddits

We can also do some interesting things with Reddit. In this example, we can pick the 5 top posts from each of our favorite subreddits, and aggregate them into a weekly newsletter that can be sent out over email.

Monitor job listings

In this last example, we’re scraping the latest job listings from Hacker News. This can alert us to any new jobs posted by YC companies over the past 24 hours.

Final thoughts

We think there are a lot of cool/interesting/fun things that can be done with relatively simple recurring jobs. Can’t wait to see what people come up with!

Please check out Taro and let us know what you think! https://www.gettaro.com/

All the code examples above can be found here.

--

--