gmb

gmb is a set of shell scripts used to generate and maintain a static microblog (in particular, this one). It supports RSS. Inspired by SoC (as seen here), but I wanted to write my own code, simply to learn how to do this.

Unless you want to publish only plain text but also want to insert hyperlinks, you still need to know basic HTML, but gmb will save you the hassle of editing your blog, writing the referrable timestamp/id and updating your RSS feed by hand.

Code

Find and fork the code on GitHub. The code is licensed under the Apache License 2.0.

Setup

gmb depends on coreutils, grep, mktemp and sed, also you'll need a text editor of your choice. Note that, due to different behaviour of sed on macOS, gmb will only run on GNU operating systems.

  1. Download the archive.
  2. Move gmbrc to ~/.config/gmb/gmbrc and edit it to set appropriate values.
  3. Move gmb.sh and gpe.sh to ~/bin and make them executable. If necessary, add ~/bin to your $PATH.

gmb is now ready for use.

Usage

Either launch gmb in interactive mode by simple invoking the script, then type your entry or prepare a textfile anywhere in your ~ and hand the absolute path to gmb as an argument.

Note that, as of now, gmb will only read one single line. Line breaks may be forced by either using the br tag or by closing the automatically added p tag and opening a new one.

Editing entries

gpe.sh (gmb post editor) helps to update the individual files that store the content of each blog post.

The string behind the second to last forward slash in an entries permanent path is handed to gpe.sh as an argument. The script will then read the necessary line, open the editor you set in gmbrc and allow for changes to be made. Saving and closing the editor will then have gpe.sh update the affected files.

As an example, suppose an entry was written on 2018-01-02 at 22:42:11 UTC. gpe.sh would be launched like so:

$ gpe.sh 201801/02224211.html

Changelog

2019-02-10

Download here.

2018-07-28

Download here.

2018-07-19

Download here.

2016-12-20

Download here.

2016-08-22

2016-07-17

2016-07-16

Unreleased. Used as a first live version. The code was extended since, overwriting the original file.


gauntlet, 2016-07-17 00:44 UTC, last edited 2019-02-10 03:30 UTC