💾 Archived View for rawtext.club › ~zilog › gawkr.gmi captured on 2023-12-28 at 16:47:08. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-06-14)

-=-=-=-=-=-=-

Gawkr -- gab(1) rewritten in gawk.

(this is just a re-worked Gopher post)

I spent much of the past Winter immersed in the AWK programming language,

something I'd pretty much only utilized as part of various "one-liners"

in my shell sessions. AWK is actually a complete "little language"

with capabilities that approach that of Perl and Python with respect to

system scripts. And anyone who spends much time with AWK likely becomes

interested in the various extensions available via Gnu AWK, aka GAWK.

Anyways, here on RTC there are several community forums for members to

share thoughts, ideas, news. Gab, written in Python, is one of the more

popular forum platforms. Gab supports multiple topic channels, both

public and semi-private as well as some extras like checking for unread

messages.

To push myself with GAWK I've been working on rewriting each gab(1) option

as its own GAWK program. Most are now done and currently bundled together

via a shell script located at ~zilog/public_bin/gawkr ; 'gawkr -h' gives

the basic usage which is nearly identical to gab(1). I added a --status

option which provides a nice heads up if sourced from ~/.bash_profile:

$ ~zilog/public_bin/gawkr -s

Current channel: gab

No unread messages.

Currently blocked:

A nice perk to using AWK/GAWK over Python is its quite a bit faster; here

is a comparison listing 200 "gab" channel posts:

$ time gab -l 200 >/dev/null

real 0m0.465s

user 0m0.246s

sys 0m0.058s

$ time gawkr -l 200 >/dev/null

real 0m0.060s

user 0m0.042s

sys 0m0.014s

ToDo:

- think of a better name..

- rewrite and make better use of dynamic libraries

- roll all the bits into one giant gawk mess..