💾 Archived View for gmi.bacardi55.io › blog › 2022 › 11 › 10 › announcing-cleanABag captured on 2023-07-22 at 16:37:37. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Posted on 2022-11-10
Since I started working on walgot[1], a TUI client for wallabag[2], I started thinking about "cleaning" articles from wallabag to avoid wasting storage (and make walgot even faster to load at the same time).
In truth, 99% of the articles, once read, don't need to stay on wallabag. Articles I want to bookmark are moved to a bookmarks.org file. But there are exception, and I'm using the "star" status in wallabag to keep some articles longer. Sometime, I just used the star as well as a reminder that I want to share it with friends (specially when behind paywall, I need to generate a public link and the mobile app doesn't allow this).
Anyway, long story short, looking at more than 1000s articles on my wallabag, the web UI didn't help me do what I wanted quickly. My main use case is simple: I want to delete articles older than a special date, but keeping the starred and unread ones.
So I coded a very quick and dirty little tool called `cleanABag', where one can simply give a date and delete all articles older than this date (with flags for keeping/removing unread and/or starred articles).
For example, to remove articles not updated since the end of 2021, including unread (`-u') and starred (`-s'):
cleanABag prune -c /path/to/config -d "2021-12-31" -u -s
/Nota/: The command above will only do a "dry run" and won't delete anything except if `--delete' is added.
Because of the way I use wallabag, I don't remove stuff frequently, so having a tool to remove thing older than, for example, a year, deleting only archived and not starred articles, quickly is a nice way of not wasting storage (or bandwidth with remote client like mobile app or walgot).
The code is available on source hut and the readme should be self sufficient:
Let me know if you have any comment on feedback.
Footnotes
_________