Grab the weather forecast using weatherapi.com

I like to record the weather in my journals. For several years, I’ve used https://wttr.in via curl. Recently, wttr has often been unreachable or would throw errors, so I took a look at https://www.weatherapi.com/

Designed for developers by developers, Weather API is the ultimate weather and geolocation API

The free account limits are generous, so I created an account. The default JSON results are very thorough. I created a little shell script that returns only the high/low temps and a text summary of the forecast:

# Jack Baty, 2023 (https://baty.net)


curl -s "https://api.weatherapi.com/v1/forecast.json?key=MYAPIKEY&q=MYZIPCODE&days=1&aqi=no&alerts=no" > $weatherfile

condition=`${jq} -r .forecast.forecastday[0].day.condition.text ${weatherfile}`
high=`${jq} -r .forecast.forecastday[0].day.maxtemp_f ${weatherfile}`
low=`${jq} -r .forecast.forecastday[0].day.mintemp_f ${weatherfile}`

echo "Low ${low}, High ${high} - ${condition}"

The output looks like this:

Low 52.1, High 72.6 - Patchy rain possible

Easy enough. I wrote a small lisp function for inserting the weather in Emacs:

(defun jab/insert-forecast ()
  "Use weatherapi.com to insert the weather forecast at point"
  (let ((w (shell-command-to-string "~/bin/getweather")))
  (insert w)))

RSS feeds as emails using Notmuch and rss2email

I’m all-in with Emacs after once again failing to get along with Obsidian.

I’d stopped using Notmuch in Emacs for email, but I brought it back after re-reading Paul Ford’s article in Wired: I Finally Reached Computing Nirvana.

Could I too start storing things as email and find them later using Notmuch?

So far, I’ve solved RSS feeds. Rather than reading feeds in NetNewsWire or Elfeed, I’m using rss2email to convert RSS feeds to emails and reading them in Notmuch.

A good reference for getting started with rss2email is LinuxBabe’s How to Install and Use rss2email on Ubuntu

The tricky part of rss2email is actually sending the emails. I eventually got things working using msmtp, which would have been fine, but it’s a lot of extra hoohah. If only I could save the RSS items directly into Notmuch. Guess what, I can!

rss2email supports writing to Maildir files. It was as easy as adding the following to my rss2email config:

email-protocol = maildir
maildir-path = ~/Mail/Baty.net
maildir-mailbox = Feeds

rss2email supports importing OPML files, but I decided to clean things up and add feeds one at a time, like this:

r2e add BatyBlog https://baty.blog/feed.rss

Then, when I want to read my feeds I run r2e run and everything ends up right in Notmuch. I don’t want them tagged with inbox” along with my real email, so I added a filter to the post-new hook in Notmuch.

notmuch tag +feed -inbox -- '(from:jack+rss@baty.net)'

I have the rss2email sender configured as so it’s easy to filter just those messages. With that hook, new RSS feed items do not appear in the inbox, but I can easily read them in Notmuch by searching for tag:feed AND tag:unread.

So there, I’ve moved my RSS feeds into emails and manage them via Notmuch.

Pebble.is and AI

Wired: X Challenger Pebble Thinks AI-Generated Posts Can Help Lure Users Away From Elon Musk:

Pebble, a Twitter-style service formerly known as T2, today launched a new approach: Users can skip past its What’s happening?” nudge and click on a tab labeled Ideas with a lightbulb icon, to view a list of AI-generated posts or replies inspired by their past activity. Publishing one of those suggestions after reviewing it takes a single click.

I hate this so much.

I’m in Easy Mode

Sometimes I feel like doing things the easy way. I don’t want to think about every step of every process. I just want to do something and then do something else.

The problem is, I can’t seem to consistently define easy”. For example, I’m typing this in Emacs for my Blot.im blog. To create this post I ran a custom lisp function that automatically creates the Markdown file, fills in the YAML front matter, and puts the cursor at the ready. Dropbox then syncs the file and Blot’s server renders the post. Easy, right? Not really. There’s a lot going on there. So is it easy if it’s easy now, even though it was difficult to get here? Or, does easy have to mean that there’s nothing to it, right from the get go?

I honestly don’t know.

Forklift 4 on SetApp

I use Forklift all day on my Mac. They just released version 4, which looked like a nice update. Forklift is included in SetApp, but wasn’t getting the update, so I was concerned it was going to be left out. I needn’t have been worried, the update was installed today via SetApp and I’m good to go.

I haven’t forgotten you, Blot.

Kev Quirk suggested that he might move away from Blot due to some weirdness and search issues. Of course this reminded me that I haven’t posted to Blot in some time and I miss how simple it all is. Plus, I like how my theme looks. Why’d I stop using it, again? 😜

Also, It’s back at the baty.blog domain, just in case.