I have a Gemini capsule as well as a gopherhole that run on separate servers, and I don't use a proxy. I like to keep the content on both the same, which is fairly easy to do for the most part as converting from gemtext to plaintext is very simple. The issue I have is with the gophermaps. In the past I have taken the links on my Gemini index pages and manually typed out the Gopher versions into gophermaps, but this is incredibly tedious to do. Is there some way to more easily and simply convert a Gemini link, or a list of Gemini links, into Gopher links or an entire gophermap?

=> Posted in: s/Gemini | ๐Ÿฆ† Arkholt

16 hours ago

4 Comments โ†“

=> ๐Ÿš€ stack ยท 8 hours ago:

sounds like you need to write a little shell script

grep out lines that start with =>

technically you should ignore links inside a ``` blockquote, but that is pretty unusual

Now splice the type -- usually zero, tab-separating description, path and server. You will need to parse the gemini link line, which contains a URL and a description, splitting the URL into path and server.

This is easy to do in a crappy way, for yourself, especially if you know the links are good etc. Hard to do it right, so it never screws up.

keep in mind that gemini links may be relative so you may have to insert your server, or not have a text description.

=> ๐ŸŽต jmcs ยท 7 hours ago:

Here's an overly simple, but maybe functional for what you need, example using grep and awk:

grep '^=>' your_gem_file.gmi | awk '{print 0"\t"substr($0, index($0,$3))"\t"$2}'

I had to try it remotely typing from my phone, so I didn't do many tests, but:

$ cat file.gmi

=> โ€” this is a link

$ grep '^=>' file.gmi | awk '{print 0"\t"subst

r($0, index($0,$3))"\t"$2}'

0 this is a link /blog/text.gmi

it will need more tweaking, but I hope it gives you a starting point :)

=> ๐ŸŽต jmcs ยท 7 hours ago:

well, my bad: after the line starting with "cat", the line with the link you'll probably see should be showing:

=> /blog/text.gmi this is a link

(I accidentally created a Gemini link by copying and pasting without using a ``` block)

=> ๐Ÿฆ‚ zzo38 ยท 6 hours ago:

For converting absolute links to other servers to gopher format, you will have to do it differently depending on the scheme (due to historical reasons). If it is "gopher" then it must be parsed and converted to a gopher menu item. If it is "telnet" then it should be converted to a type "8" menu item. Otherwise, use a type "h" menu item, put your own host/port, and the selector string is "URL:" followed by the URL. If your server receives such a request, it should return a HTML file containing a link and/or redirect to the target URL (but clients that understand this convention will not need to request the HTML file from your server, so it is OK if the client doesn't implement HTML).

Proxy Information
Original URL
gemini://bbs.geminispace.org/s/Gemini/23988
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
82.95983 milliseconds
Gemini-to-HTML Time
1.72878 milliseconds

This content has been proxied by September (ba2dc).