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: git.oscarbenedito.com/osf/file

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

echo -ne "gemini://example.com/path/to/f" | ncat --ssl example.com 1965 | tail -n +2 | ./gemini-to-html.py

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/gemini-to-html.py

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

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.