💾 Archived View for gmi.bacardi55.io › blog › 2022 › 11 › 10 › announcing-cleanABag captured on 2023-09-08 at 16:12:47. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

cleanABag, a tool to remove old articles from wallabag

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:

cleanABag repository

Let me know if you have any comment on feedback.

Footnotes

_________

[1]: Walgot, a wallabag TUI client

[2]: Wallabag homepage

/gemlog/

Send me a gemini mention

send me an email!