💾 Archived View for jsreed5.org › files › microblog › index.gmi captured on 2022-06-11 at 21:08:00. Gemini links have been rewritten to link to archived content
View Raw
More Information
⬅️ Previous capture (2022-06-03)
➡️ Next capture (2023-05-24)
-=-=-=-=-=-=-
Offline Microblog
---
Script
Script File
(SH, 13.5 KB)
Current version: 0.7
Function and Features
This script creates and manages a Markdown-formatted timeline file. The user calls the script with the path to the timeline file as its only argument. From there the user can compose new posts, read previously-written posts, and perform other functions.
Features:
- Automatic post numbering
- Date, time and timezone on all posts
- Post length limit support (soft limit)
- Post deletion
- Attachment support
- Avatar support
- Draft saving and loading
- Attachments can be saved and loaded with drafts
- Reply support, including forward replies
- Atomic post read-back
- twtxt cross-posting support
Attachments are stored in a directory called "attachments" in the same location as the timeline file. A directory called "_working" is also created, which is used for internal files as well as storing drafts.
The actual code is a bit of a mess. If you have any suggestions or improvements, feel free to reach out to me!
Requirements, Quirks and Caveats
- bash 5.0+ is required.
- GNU sed is required.
- bc is required.
- nano is required by default, but it should be trivial to edit the script to call any editor you prefer.
- After deleting a post, reindexing can be very slow if it has many (1000+) posts to process. This will be fixed in a later version.
- twtxt cross-posting writes to a file "_twtxt.sink" in the same directory as the timeline. Symlink your twtxt file to this file to use it seamlessly.
Background
When I used Twitter (before 280 characters became standard), I had a private secondary account that I used as a "rant" account. If I wanted to vent, spam, ramble, or simply write something inappropriate, I would post it there. No-one followed the account, and the account didn't follow anyone. I got used to writing my thoughts as a stream of conscience, necessitated by the fact that each snippet had to be 140 characters or less. I closed that account in early 2017.
The germ of this script formed in mid-2019. I had recently installed the note-taking app Markor on my smartphone and had just finished converting my personal notes to Markdown. Markor has a button in its toolbar that automatically inserts the current date and time into a note. I began to use this feature to write free-form journal entries, but as time passed, I discovered that I missed the specific micro journaling format I had grown accustomed to on Twitter. I decided to write a script to mimic the timeline properties of Twitter, a script I've been developing ever since.
For my own purposes, I consider this script functionally complete. I intend to eventually make it portable and POSIX compliant, at which point the version will be bumped to 1.0.
License
For purely legal purposes, this script is distributed under the terms of the simplified (2-clause) BSD license.
License Text
(TXT, 1.23 KB)
Changelog
Because I had originally written this script for my own use, I didn't keep very many old versions, so this changelog is only partial.
2022-05-06: 0.7
- Move working directory from "_working" to ".working"
- *** NOTE: Existing drafts will not be accessible unless they are manually moved to the new directory. The original directory can be deleted. ***
2022-04-21: 0.6.5
- Create attachments directory if not found
2022-02-28: 0.6.4.2
- Standardize command substitution format
- Modify copyright to include current year
- Meta: fix formatting on index page
2022-01-25: 0.6.4.1
- Declare counter properly before being used
2022-01-21: 0.6.4
- Add line break after avatar in header
- Option to generate simpler avatar from ID, default to unique avatar
2022-01-21: 0.6.3
- Remove unused redirection in while loop
- Make user IDs generate unique default avatars
2022-01-21: 0.6.2
- Add missing space in second menu
- Standardize "c" as a proactive confirmirmation option in all cases
- change twtxt option from "c" to "t" to standardize function of "c"
2022-01-19: 0.6.1
- Fix bash not specified in shebang
- Print ID next to username in first menu
2022-01-19: 0.6
- Add user ID (UUID) when creating a new timeline
- Add proper avatar support
- Optionally generate avatar SVG file from user ID
- Offer to cross-post to twtxt at post time
- *** NOTE: This update changed header formats slightly and is not compatible with existing headers out of the box. To use this version with existing timelines, run the script once in an empty directory to create a new header, then copy the new header over the existing header. No other changes to the timeline file are required. ***
2022-01-16: 0.5.3
- Add twtxt cross-posting support
- Meta: version 0.3.9.3 rediscovered; changelog modified to include it
2022-01-05: 0.5.2.1
- Allow uppercase and lowercase for all options, not just main menus
2021-12-06: 0.5.2
- Allow inputting options as uppercase or lowercase
2021-11-19: 0.5.1
- Fix incorrect readback search pattern
2021-11-10: 0.5
- Change grep header search pattern
- More robust index updates when a post is deleted
- Find post to delete based on line number instead of sed pattern
- Anchor forward reply position based on next header
- Bump version number
2021-11-09: 0.4.4
- Add post deletion function
- Read-back: show latest post if any errors are encountered
- Remove _body if post is empty
- Add two newlines between nonempty post body and first attachment
- Fix broken forward replies
2021-11-03: 0.4.3
- Change post header count and config load methods
- Store _body and drafts as POSIX-compliant text files
- Add timezones to all dates
- Add BSD license
2021-10-25: 0.4.2
- Check if _working directory exists on each run and create if needed
2021-10-19: 0.4.1
- Complete rewrite
- Major refactoring: reduce ~800 SLOC to ~200
- Remove state function completely
- Remove quick-post option
- Remove broken post header repair function
- Remove usage and version functions
- Remove .dat directory
- Store attachments and _working directories at top level
- Remove conf file; get config options from timeline directly
- Remove index file; get post count from timeline directly
- Insert newlines between attachments instead of HTML <br> tags
- Change attachment naming scheme
2021-09-21: 0.3.9.6
- Rename "helpme" function to "usage"
- Move .conf file to .dat/conf
2020-12-06: 0.3.9.3
- Standardize printf statement formats
- Touch post body on every run
- Fix attachment count reverting to 0 when loading drafts with attachments
2020-11-26: 0.3.9.1
- Base version for changelog
---
Up One Level
Home
[Last updated: 2022-04-21]