A command-line tool for managing Atom feeds written in Babashka.
Atomize is a simple utility that helps you manage Atom feed files. It allows you to add new entries to an existing Atom feed while maintaining a specified limit on the number of entries. If no feed file exists, it will create one with a default template.
bbin install io.github.200ok-ch/atomize
atomize [-i [-b]] [-n=<entry-limit>] <atom-file>
-i, --inplace
: Update the atom file in place-b, --backup
: Keep backup of original atom file (only works with -i)-n, --entry-limit=<entry-limit>
: Number of entries to keep [default: 20]-h, --help
: Show help message
The script expects a JSON input through stdin with the following structure:
{
"title": "Entry Title",
"url": "https://example.com/entry",
"id": "optional-unique-id",
"updated": "optional-timestamp",
"summary": "Entry summary",
"content": "Entry content in HTML",
"author": "Author name",
"email": "[email protected]"
}
All fields are optional and will use default values if not provided:
- title: “Untitled”
- id: Random UUID
- updated: Current timestamp
- summary: “(summary missing)”
- content: “(content missing)”
- author: System username or “(author missing)”
- email: “(email missing)”
- Create a new feed and add an entry:
echo '{"title": "My First Post", "content": "Hello World!"}' | atomize.bb -i feed.atom
- Update existing feed with backup:
echo '{"title": "Another Post"}' | atomize.bb -i -b -n=10 feed.atom
tbd.