👋đŸģ Currently looking for work!
Please see my LinkedIn profile and get in touch, or see ways to support me in the interim.

â€Ļ has too many hobbies.

How I share Bird Buddy photos online

I've developed a simple and fast workflow, along with several purpose-built pieces of software, for sharing Bird Buddy photos online here. I had several goals for this process:

  1. Photos should be shared to a Lychee photo album on my picture-sharing subdomain
  2. Uploading the photos should be as fast as possible
  3. Bird photos should be titled according to what Bird Buddy thinks the birds are
  4. The pictures site should provide separate RSS feeds for Bird Buddy and "everything else," since this is a high-traffic album
  5. The Bird Buddy photo feed should be accessible on the Fediverse (in practice, via Mastodon)

Items 1 and 2 are easy enough: I can just save the photos from the Bird Buddy app to my phone, then upload them using Lychee's interface.

Requirement 3: Photo Titles

Unfortunately, the photos downloaded from Bird Buddy's app have no metadata attached. (It would be nice if the EXIF data included the identified bird species, but alas, no such luck.)

They show up in Lychee using the file name as the title, and the file names are UUIDs like 0A45E363-776F-44F6-9165-F3E1AEE11CE6.jpg. The identified species is included as a textual overlay in the image.

But we can use those facts! I wrote a bit of software that:

  • Connects to the Lychee MySQL database
  • Looks in the Bird Buddy album for any photos that with titles like [UUID].[ext]
  • Sends the lower portion of the photo to Google Cloud for OCR
  • Sets the photo's title to the OCR result

This runs every half hour, and it works great! As a bonus, if there's no text in the image (which happens when Bird Buddy can't identify the bird), this program adds a to-do item to a list in Things, asking me to manually ID the bird and update the photo title.

GitHub - cdzombak/lychee-birb-title: Set titles for Bird Buddy photos in your Lychee photo library
Set titles for Bird Buddy photos in your Lychee photo library - cdzombak/lychee-birb-title

Requirement 4: RSS Feeds

Providing separate RSS feeds for Bird Buddy photos vs. "everything else" is accomplished using feedfilter, which I wrote about previously. This is simple enough — feedfilter is configured on my server to run twice.

On one run it consumes the Lychee RSS feed and produces an RSS feed of everything in the Bird Buddy album, and on the next run it produces a feed of everything not in the Bird Buddy album.

feedfilter also filters out any photos that haven't been titled yet, so the RSS feed never contains bird images with ugly UUID titles.

These feeds are advertised on my Feeds page. Soon they'll be injected into the Lychee pages' HTML headers for easier discovery, using a cursed HTML-parsing-and-modifying reverse proxy program I'm currently writing. More on that soon!

The feed also powers the "recent birb friends" section of my homepage.

Requirement 5: Fediverse

Finally, the Bird Buddy RSS feed is published to its own Mastodon account.

I accomplish this by running mastofeed-dzombakdotcom, which just checks the Bird Buddy RSS feed every minute and posts anything new to Mastodon.

GitHub - cdzombak/mastofeed-dzombakdotcom
Contribute to cdzombak/mastofeed-dzombakdotcom development by creating an account on GitHub.

Bonus: Updating taken_at

Lychee sorts albums using their photos' taken_at dates. But the Bird Buddy album was not sorted as I expected, since as mentioned above the Bird Buddy photos don't have EXIF data attached.

So, I wrote this quick script (run every so often via cron) that finds all Bird Buddy photos that need taken_at dates, and populates that field based on the photo's upload date. It's not perfect, since sometimes I upload photos that are a few days old, but it's close enough.

Discussion: Claude Code

A recurring theme with my recent posts is that this is stuff I wouldn't have written without Claude Code. Nobody has the free time to write bespoke bird photo OCR software for themselves. But I was able to get it working in very little time with Claude Code, and make some minor changes & improvements myself.

I've historically been an LLM skeptic, and for many use cases I still am, but for programming, the results speak for themselves.