GOPHHUB UPDATES

Wow it looks like I've been tweaking things with GophHub for a
month and a half now! It's definately time to move onto something
else for spare time, so I've finally published the script in the
scripts section here, which I also tidied up a bit because it was
turning into a mess.

gopher://aussies.space/1/~freet/scripts

The version running at Tilde.Club has been calling itself 1.0 for a
while now, but now it might stop silently changing/breaking (not
that I think it was being used enough by others that anyone would
have noticed).

gopher://tilde.club/1/~freet/gophhub/

All the pending features listed in my last post have been applied,
plus I thought up a few more such as showing the latest Git commit
date and comment. It now does everything that I cared about from
the official GitHub repo web interface, and I've been using it
frequently because so much damn stuff is hosted on GitHub now! Next
will probably be trying to implement support for Issues and Wikis,
but for now they're still usable (albeit ugly) without Javascript
on the GitHub website.

One divergence from the GitHub website is that the display of the
default README file below the root directory list of a Git repo is
now limited to a 25-line preview in GophHub, because many READMEs
are _huge_ and it seemed out of keeping with Gopher to dump them
into a gophermap (where they can't be scrolled through in the UMN
Gopher client anyway).

The hardest part was converting relative and absolute links in
HTML-rendered MarkDown/ASCIIdoc documents to point to GophHub
locations for files and directories, or 'raw' download links for
binary content (such as images). There's an absolute monstrosity of
a GNU Sed command where I've done the link-rewriting using a long
sequence of regular expressions. It was a real pain to get right,
but document links now work better than they ever did browsing the
GitHub website in Dillo. This does of course work best if you're
using a web+gopher browser. I mainly use Dillo with the Gopher
add-on by Charles E. Lehner:

http://celehner.com/projects.html#dillo-plugins

Note that, like the Gopher support in old versions of Firefox, that
doesn't work with URL parameters on search items. So selecting the
options settings at the GophHub homepage doesn't work (from other
pages, it does). In Dillo it works if you set up search items like
this in dillorc (one for directories and one for files, in order to
get the item type right):

search_url="GophHub gopher://tilde.club/7/~freet/gophhub/?html=1&num=1&__gopher__query__=%s"
search_url="GophHub (file) gopher://tilde.club/h/~freet/cgi-bin/gophhub.sh?html=1&num=1&__gopher__query__=%s"

In the UMN Gopher client it's probably better to keep everything
plain-text, but with downloads over Gopher instead of direct HTTPS
links for small files. So in .gopherrc:

#
Type=7
Name=GophHub
Path=/~freet/gophhub/?raw=1
Host=tilde.club
Port=70

I'm certainly not going to do something like this for every website
that goes Javascript-only. At least GitHub has a documented API
which currently claims an intention to remain stable, with versioned
implementations. Damned if I'm doing this for a website that I have
to reverse-engineer first, _then_ do all this work, then have it
change completely the next month.

Except even in this case it seems I _almost_ didn't have to. Via
the endless complaints thread on GitHub's website about the new
"code view" interface, I discovered (too late) this existing
web-based GitHub 'front-end', called GotHub:

https://codeberg.org/gothub/gothub

Trouble is, even though it doesn't require Javascript, it's almost
as broken as GitHub is without Javascript because it seems that it
also lost its directory navigation when GitHub stopped listing Git
sub-directories in plain HTML:

https://codeberg.org/gothub/gothub/issues/124

Moreover, the developer isn't interested in doing the work to fix
this, so it's currently in limbo:

https://codeberg.org/gothub/gothub/issues/131

It also has some fairly silly CSS which in Firefox centres the
source code in a narrow section at the middle of the screen (at
1024x768 resolution, I assume it makes a little more sense on
widescreen monitors), and the syntax highlighting is done in CSS
too, so you lose that if you turn it off. Still, I'm obviously
always going to prefer my version.

I might mention GophHub to the developer as something they can
point others too instead. To this end I took a look at Web proxies
to Gopher, but some actually require Javascript for search items to
work, and then don't work anyway. Floodgap's proxy is the only one
that's usable, except that HTML content is blocked by it so GophHub
doesn't work in document/source HTML-rendering mode. Anyway after
some short consideration I decided this wasn't enough cause to try
and make GophHub support web access as well. Many Gopher clients
are better suited to browsing directory-oriented content than web
browsers anyway.

Feedback and suggestions are still welcome. GotHub had a remarkable
number of nine 'instances' on different servers. GophHub certainly
doesn't need more instances to avoid running into API access
limits, in fact my creating a GitHub account in order to get an API
key for >50 requests per hour looks like it was a waste of time.
But if you do set GophHub up somewhere else, let me know and I'll
start a list someplace.

- The Free Thinker