Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 1.69 KB

README.org

File metadata and controls

58 lines (48 loc) · 1.69 KB

Atomize

A command-line tool for managing Atom feeds written in Babashka.

Description

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.

Installation

bbin install io.github.200ok-ch/atomize

Usage

atomize [-i [-b]] [-n=<entry-limit>] <atom-file>

Options

  • -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

Input Format

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": "author@example.com"
}

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)”

Example Usage

  1. Create a new feed and add an entry:
    echo '{"title": "My First Post", "content": "Hello World!"}' | atomize.bb -i feed.atom
        
  2. Update existing feed with backup:
    echo '{"title": "Another Post"}' | atomize.bb -i -b -n=10 feed.atom
        

License

tbd.