https://github.com/200ok-ch/keeptrack
Keep track of changes without going crazy - clean versioned history
https://github.com/200ok-ch/keeptrack
Last synced: about 2 months ago
JSON representation
Keep track of changes without going crazy - clean versioned history
- Host: GitHub
- URL: https://github.com/200ok-ch/keeptrack
- Owner: 200ok-ch
- Created: 2025-06-23T15:31:52.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2025-06-23T17:38:56.000Z (3 months ago)
- Last Synced: 2025-06-23T18:24:24.828Z (3 months ago)
- Language: Clojure
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* keeptrack
Keep track of changes with a clean versioned history
** Overview
=keeptrack= is a Babashka script that monitors URLs for changes and
maintains a versioned history of content. When content changes, it
creates timestamped versions and can optionally trigger custom
handlers.** Installation
#+begin_src bash
bbin install io.github.200ok-ch/keeptrack
#+end_src** Usage
#+begin_src bash
keeptrack [options]
#+end_src*** Options
- =-d, --debug= - Print debug messages
- =-h, --handler=COMMAND= - Command to execute when new version is created
- =-s, --storage=PATH= - Storage directory (default: =~/.keeptrack=)
- =-t, --tempdir=PATH= - Temporary files directory (default: =/tmp/keeptrack=)*** Handler Substitutions
When using the =--handler= option, you can use these placeholders:
- =%o= - Path to the old file
- =%n= - Path to the new file
- =%l= - Previous version
- =%v= - New version** Examples
*** Basic Usage
#+begin_src bash
keeptrack https://api.example.com/data.json
#+end_src*** With Custom Storage
#+begin_src bash
keeptrack -s ~/my-tracking https://api.example.com/data.json
#+end_src*** With Handler for Notifications
#+begin_src bash
keeptrack --handler="echo 'New version: %n'" https://api.example.com/data.json
#+end_src** How It Works
1. Downloads content from the specified URL
1. Compares with the latest version (if exists)
1. Creates timestamped file if content changed
1. Updates symlink to point to latest version
1. Executes custom handler if specified** File Naming
Files are stored with the format: ={timestamp}-v{version}.json=
Example: =api-data-20250623T143052Z-v5.json=
** Dependencies
- Babashka
- curl
- cmp
- date