Using netcat with gemini (was Re: A question regarding the spec)

Gary Johnson lambdatronic at disroot.org
Wed Oct 28 19:20:53 GMT 2020


Netcat (ncat) does support SSL connections with the --ssl flag.

Here's my little "gemget" Guile script I wrote that lets me poke around
Geminispace from the command line whenever I'm not inside a proper
Gemini client. It's also useful for scripting in situations where you
might use wget with HTTP(S).

-----------------------------------------------------------------------------
#!/usr/bin/env guile
!#

(let ((args (command-line)))
  (if (not (= 2 (length args)))
      (display "Usage: gemget <GEMINI_URL>\n")
      (let ((url (cadr args)))
        (if (not (string-prefix? "gemini://" url))
            (display "GEMINI_URL should begin with gemini://\n")
            (let ((server (caddr (string-split url #\/))))
              (system (simple-format #f "echo ~S | ncat --ssl ~S 1965" url server)))))))
-----------------------------------------------------------------------------

Just save this in a file called gemget somewhere on your PATH and you
can use it like this:

-----------------------------------------------------------------------------
gjohnson at euclid ~ $ gemget gemini://gemini.circumlunar.space/
20 text/gemini
# Project Gemini

## Overview

Gemini is a new internet protocol which:

* Is heavier than gopher
* Is lighter than the web
* Will not replace either
* Strives for maximum power to weight ratio
* Takes user privacy very seriously

## Resources

=> docs/	Gemini documentation
=> software/	Gemini software
=> servers/	Known Gemini servers
=> https://lists.orbitalfox.eu/listinfo/gemini	Gemini mailing list
=> gemini://gemini.conman.org/test/torture/	Gemini client torture test

## Web proxies

=> https://portal.mozz.us/?url=gemini%3A%2F%2Fgemini.circumlunar.space%2F&fmt=fixed	Gemini-to-web proxy service
=> https://proxy.vulpes.one/gemini/gemini.circumlunar.space	Another Gemini-to-web proxy service

## Search engines

=> gemini://gus.guru/	Gemini Universal Search engine
=> gemini://houston.coder.town	Houston search engine

## Geminispace aggregators

=> capcom/	CAPCOM
=> gemini://rawtext.club:1965/~sloum/spacewalk.gmi	Spacewalk

## Gemini mirrors of web resources

=> gemini://gempaper.strangled.net/mirrorlist/	A list of mirrored services

## Free Gemini hosting

=> users/	Users with Gemini content on this server
-----------------------------------------------------------------------------

Have fun and happy hacking!
  Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the Gemini mailing list