I created a small script to parse text/gemini files to HTML (to be able to add them to Wallabag). If you are interested, it's here:

It works well with pipes so you can download files and parse them easily from the command line, for example:

echo -ne "gemini://" | ncat --ssl 1965 | tail -n +2 | ./

will output the HTML content (assuming the gemini header is "20 text/gemini").

You can create a shell function to make it simpler:

gmi() {
echo -ne "gemini://$address\r\n" | ncat --ssl $domain 1965 | tail -n +2 | /path/to/

And then call "gmi > file.html". You can also add additional checks for the gemini response code if you want 😃.

@ob ncat! I've been looking for something like ncat for *ages*! In fact, I tried (and failed) to write one. Thanks.

@wizzwizz4 Glad you found it! To be fair, that command is not originally mine, I read it somewhere. It's great to get gemini pages on the command line easily (and now to pipe them to my new script!)

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.