Glob: The Magic of Google Docs, APIs, and Open Source

by Tim

A couple weeks ago, I had a problem: I wanted to send Google Docs through the mail. Specifically, I wanted to send physical copies of legal notices to our tenants.

I had pieces of the puzzle already in place. The templates were in Google Docs, where I could edit them for the specifics of the situation (ex. name, address, date). The mail aspect worked through Lob, which takes a PDF, prints it, and sends it via USPS to any address you specify. I made the system work manually, but it was an obvious case of using humans to do work best suited for computers—the antithesis of the automated property management that Castle is working to achieve.

Like a good digital native, my first instinct was to Google exactly what I wanted. The second result was Glob, an ad-on for Google Docs that sends a doc to Lob using the latter’s API. Jackpot, right?

I sure thought so. As it turns out, though, the program had a couple serious bugs, and there hadn’t been any development in two months. Not exactly the silver bullet I was looking for.

Here’s where the magic of open source and GitHub come in. Instead of moping about my best hope being a mere mirage in the desert of search results, I resolved to fix the bugs myself. I forked the original repo, made the changes I needed, and pushed the results.1 Now I had a solution I could share with the world! I encourage you to check it out, use it, and report any issues you have through GitHub.

Glob in action

Reflecting on the process, I have three main takeaways:

  1. Google Apps Script, the scripting language for Google services like Gmail and Docs, is a casual hacker’s paradise.
  2. APIs are the secret sauce that makes the internet so great.
  3. Open source software is a gift to mankind.

Big thanks to Mike Steele, the original creator of Glob, for wading through the Google Apps Script and Lob API documentation and putting together the original working product. Thanks also to Scott, Castle co-founder and CTO, for answering my dumb questions and encouraging me to build things.

  1. I also accidentally pushed our Lob API keys, which is the internet equivalent of publishing your Social Security number in your company’s advertisements. Thankfully, API keys are easy to regenerate.