Re: Issues with the reference gopher client, magic is needed.
On Fri, 26 Jan 2018 20:21:22 +0100
Quentin Rameau <quinq@fifth.space> wrote:
> On Sat, 27 Jan 2018 11:29:20 -0700
> "Mr. Leveck" <leveck@leveck.us> wrote:
>
> Hello Nathaniel,
>
> > Seeking advice.
> >
> > I wrote a tiny sh script that uses gsed (I need regex) to clean up
> > the gophermap output for the cgi code on the Gutenberg rewrite.
>
> Where can we see the code, is it
> gopher://dante.pglaf.org/0/cgi-bin/sourcecode ?
>
> > Lynx of
> > course displays perfectly. Sacc displays my leading `i' on text
> > lines (!! -- if you use telnet, or G in lynx to change the type to
> > 0 or pipe to od -c the output is identical to any other gophermap
> > so I do not understand this behavior). UMN Gopher randomly chooses
> > to display or not text lines.
> >
> > Text lines start with i. Text lines end with \tnull.host\t1. EOL is
> > \r\n.
>
> Text lines are expected to be formated as any types:
> 1descriptive name\tselector\tserver address\tport\r\n
>
> > What is the magic reference gopher expects?
>
> You can find the reference here https://www.ietf.org/rfc/rfc1436.txt
> although it's a little dated and sometimes a little imprecise.
>
> > Basically every cgi app I
> > have ever written refuses to correctly display in gopher unless it
> > is called from a gophermap as `=cgi-bin/app' -- which does not work
> > for type 7.
> >
> > Disclaimer to avoid a lecture: Yes, I am fully aware I am
> > shoehorning functionality into something that wasn't designed for
> > it. However, unless I can pass user input there will be no search.
> >
> > Help!!
>
> With pleasure, if you have the means to, you can come talk directly on
> IRC too, #bitreich-en on Freenode.
>
The code is currently living on my laptop. Text lines should not begin
with `1' that is a directory, i is the suffix.
here is the current working copy of the e script:
#!/bin/sh
. ../conf
echo "$1" | sed -r 's/\\n/\n/g;' | sed -r
's/^/i/g;s/^i0/0/g;s/^i1/1/g;s/^i7/7/g;s/^i /i/g;s/\\t/\t/g;' | sed -r
'/^i/ s/$/\tnull.host\t1/g;s/$/\r/g;'
it uses gsed. the usage is in a cgi app: e "text"
It is a WIP and some things in the line above never get triggered. It
has been mutating for three days. Frustration has set in...
--
Nathaniel Leveck
gopher://gopher.leveck.us
https://www.leveck.us
Reply to: