DEV Community

Gabriel Romay Machado
Gabriel Romay Machado

Posted on • Edited on

How to transform your blog into a podcast for free

Some Context

I recently developed a solution to turn old books into a podcast πŸ“š. I had the idea of adapting this for transforming my text blog into an audio blog 🦻. Because I don’t have a decent microphone in order to use my own voice πŸ™Š. And because we live in the future 🌟.

Anyway, it seems that one of the blogging platforms I’m currently using, is already offering a similar feature. I listened to some examples and it sounds great πŸ‘πŸ½, I wanted to try it on my own blog!

But it’s still experimental and you can only use it if you’re an Ambassador πŸ€·πŸΌβ€β™€οΈ. In addition to that, I wanted to be able to fully customize the audio output and play with it a bit, so the way to go was clear: Hacking Time πŸ‘©πŸ»β€πŸ’»!

What I needed

  • A way of getting all my articles from Hasnode into my task πŸ“ƒ
  • An adaptation of my text-to-voice task βš™
  • A way of getting the voice file into anchor.fm, my podcast platform of choice 🎧

How it went

  • I believe Hasnode already offers an API that lets you get your posts quite conveniently, but I was more interested in its backup feature. You see, if you create a github repository and give permissions to Hashnode, it will download your posts in .md format after every new creation or edition. It's quite easy to configure ☺! You only need to go to your blog dashboard and select β€œbackup”.

  • I decided to create my new tasks in an independent repository for security reasons γŠ™

  • I found a github repository, made by an Italian organization named Schrodinger-Hat πŸ±β€πŸ’», for converting a youtube video into an audio file and uploading it to anchor.fm. The upload task used puppeteer for that and I thought it was quite cool and simple, so I just forked it 😏. They are great, check them out!

Lessons learned or pending to learn

This project wouldn't be possible without three wonderful open-source projects: the node-gtts library, the fluent-ffmpeg library and the youtube-to-anchorfm repository. I have known for years how wonderful our software development global community is, so I’m impressed, but not surprised πŸ₯°.

The fruits of hard work

As I said at the beginning, you can already check the audio version of this post in anchor.fm. And one great feature of anchor.fm is that it distributes it to other platforms too: Spotify (which makes sense, as the same company owns both), Google Podcasts, Pocket Casts… so convenient πŸ‘πŸ».

And of course, this repository is available on github.

Is there a future for this project?

I’m still developing some features related to the voice file generation: using sounds as substitutes for emojis 😢, adding all the links inside the blog post text into the audio post description πŸ“‹...

The original repository I forked contains code for creating a Github action to execute the download and upload task. When I finish adding the rest of the features I mentioned, it would be nice to have it all automated and just need to access GitHub to publish a new audio post βš™.

And the best thing is that this project can be easily adapted to work with different blogging and podcast platforms 😏!

So yeah, its future looks just bright ✨.

Top comments (0)