Latest Post

Sucking up the podcasts I've listened to

Days to save minutes

Mar 16, 2019

Finally, I have succeeded in importing all the podcasts I have listened to with the Overcast app, at least as far back as May 2018.

This crazed exercise was prompted by my total inability to find an episode that I know I had heard, and modelled on the very excellent Python script by @cleverdevil. Of course, not speaking a word of Python, I had to translate it into pidgin PHP, which I started doing on 27 February.

And here we are, after a lot of great help from my pals in the IndieWeb IRC.

My version is way too buggy to release just yet, and in any case is not fully automated. I have not managed to ensure that episodes for which I have already created posts are not duplicated. I'm also still not entirely happy with the actual logic of my program. But at least it works, as far as it works.

The biggest programming problem is that the detailed OPML file that Overcast sends me is a beast to work with, especially as I am not all that good at handling deeply-nested arrays. I tried to use SimpleXML instead, but failed to make much progress. Still, I know where I need to improve things. How is a different matter.

I'm leaning towards comparing the current OPML file with its predecessor and extracting only things that have changed, but the nesting makes that rather complex. Extracting entries with a date more recent than some arbitrary moving target might also be a way.

As far as the information itself is concerned, I'm broadly happy with that too. Right now, each post contains the data supplied by the podcast to Overcast, untouched by human hand, and a link to the episode on Overcast. Ideally, when I have caught up, I would have time to add any notes I may have, and maybe even edit the official summary where I think it could use a clean-up.

The other thing I need to do is work out how best to handle skipping an episode and deleting ones I have listened to. Currently, that's all manual. If I let Overcast handle it, the OPML file might be easier to use.

The time spent, I regard as worth it, for two reasons. First, learning more about PHP and Grav (or about anything, for that matter) is always worthwhile. Secondly, even though manual steps are still needed, if I had to enter each podcast manually as I listened to it, I wouldn't.

Eat This Podcast

Using food as a vehicle to explore the byways of taste, economics and trade, culture, science, history, archaeology, geography and just about anything else.

Nominated for a James Beard Award in 2015 -- and again in 2016 -- and going from strength to strength.

Subscribe to the podcast in iTunes or by email and get a new episode every two weeks. And a newsletter to stave off the pangs between podcasts.

Older Posts


Eating a legend

My meeting with the Mangalitza

Mar 8, 2019

Profile picture

Jeremy Cherfas

Freelance Communicator

In essence, I see myself as a translator. I speak Science, and I speak English, and I work hard to make the two understand one another. Mostly, I like to help people tell their stories. I'm a biologist by training and by inclination, and my main joy is applying that to food and the agriculture and industries that supply it.

I also have side interests in economics and many other things.