#!/bin/bash # f2g: A simple finger2gopher script that renders a gopher map over the # the finger protocol using the text browser lynx. # Usage: # f2g user@domain.com (or) f2g finger://domain.com/user # Converts finger-based urls into a lynx-friendly gopher format (saving # you precious seconds:-): lynx gopher://domain.com:79/1user # Copyright (c) 2025-2026 (https://640kb.neocities.org) # Licensed under the Blue Oak Model License 1.0.0 # --------------------------------------------------------------------------- convert_to_gopher() { local input="$1" local domain="" local user="" if [[ "$input" == finger://* ]]; then domain="${input#finger://}" domain="${domain%%/*}" user="${input#finger://*/}" else user="${input%%@*}" domain="${input##*@}" fi echo "gopher://$domain:79/1$user" } if [[ $# -eq 0 ]]; then echo "" echo " Usage: $0 user@domain.com or finger://domain.com/user" echo "" exit 1 fi for arg in "$@"; do gopher_url=$(convert_to_gopher "$arg") echo "Executing: lynx $gopher_url" lynx "$gopher_url" done