coaching newsletter contact

A Text File Weather Forecast

It never fails. I sit at our kitchen table over breakfast and mention to my wife that it's going to snow that day. The first question she asks? "How much?" I don't know! All I know is that my alert says it's supposed to happen!

After going through this exchange so many times that my wife realized she was driving me crazy then continued to ask because she enjoys taunting me, I gave up and created my own weather forecast. I wanted to know temperatures and precipitation amounts and keep a daily record of each forecast. I figured if I was going to go through the trouble of creating it, I might as well make it possible to search a date and get the forecast from that day. I turned to text files and Google Scripts.

Today

To set this up, you'll need access to Google Drive and a developer account with Weather Underground.

  1. Create a new Google Apps Script in Google Drive.
  2. Paste the code below into the script.
  3. Replace the _X_s in the script with your Weather Underground API key and change the city/state to your location.
  4. Set up a trigger to run the function automatically (Resources > Current project's triggers).

Here's the script you'll need:

When run, the script will create a text file at the top-level of your Google Drive. From there you can use Hazel to move and rename these files however you like. For example, I use Hazel to rename the files to just the date and move them to DropBox within my text file setup.

Yesterday

Once I had today's forecast working properly, I took the next step: keeping a history of what actually happened the day before. This was primarily so I could determine how much rain we had yesterday. I grew up on a crop farm. The most common question in a farming community is, "How much rain did you get last night?" That almost instinctual curiosity has never left me, but instead of setting up a rain gauge like most good farmers, I just altered my forecast script to give the data from the day before in the same format.

Everything for this historical record works the same as the forecast. The only difference is the location of the API call and the parsing of the data.

The benefit of having both of these in place is the ability to compare the forecast to what actually happened. The only issue with doing this is the result: it shows just how bad forecasts really are at predicting weather. But hey, at least breakfast with my wife is less maddening.

Thu, Mar 31, 2016 07:00pm CDT https://bhlg.us/4gX12
#text-files #weather

Want to see my August 2020 Bullet Journal setup?

Join 1,514 subscribers!

I'll send you the link to a six-minute overview video of my August 2020 spreads when you sign up for my newsletter, The Weekly Impulse.

Site Analytics

I use Fathom Analytics on this site because I care about your privacy. And if you ever want to see the stats collected and the data I see, check out the live analytics here.

Amazon Affiliate

joebuhlig.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees when linking to Amazon.com and affiliated sites.

Disclaimer

Disclosure of Material Connection: Some of the links in the post above might be “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

an analog mind in a digital world

👋 I'm Joe Buhlig. I strive to build productivity systems that stand the test of time and help me do more than check boxes. I'm here to help you do the same.

🎙 I read a lot of books and talk about it.

🐿 I can't focus on one thing for long, so I write a lot of code for an eclectic grouping of projects.

📓 And I'm a bit obsessed with finding non-proprietary solutions to digital problems. Thus, text files for the win! 🎉

MN U.S.A 1986-09-30
  • all
  • articles
  • code
  • likes
  • notes
  • photos
  • replies
  • reposts
  • steps
  • videos
coaching newsletter contact
© 2014-2025 by Joe Buhlig