4 ms·
I personally find the concepts that the Mutt UI implements to be amazingly efficient for any task that requires human review of individual items in a set. For
by steelframe 6y ago
I personally find the concepts that the Mutt UI implements to be amazingly efficient for any task that requires human review of individual items in a set.
For example, I am a moderator for a popular subreddit. I've written a Python app that uses the requests module to interact with the Reddit API and displays the items on the mod queue via curses, Mutt-style. I use columns to give me succinct metrics on each element, such as the number of times the author of a submission posted the same URL across other subreddits (that's a strong indication of spamming). I move around the list with vim-like key bindings (i.e. k/j for up/down), and when I want to approve a post or comment, I just hit 'a'. If I want to remove a post or comment and ban the author, I just hit 'b'. If I want to dig in to the post or comment to get more data about it, such as view its full contents along with all the reports on the item, I just hit space or enter. From there I can hit one of the usual keys to approve, remove, etc.
Since I'm a huge fan of instant UI feedback, I immediately remove the item from the list once I've hit a keystroke to take action on it. I asynchronously schedule the Reddit API call on a queue that implements the action, making sure to .join the queue on the app quit path so if I'm feeling especially twitchy about blasting through the mod queue and leaving before all the API calls can complete, I don't leave them dangling.
Any time I have any tasks at work that require manually making quick-fire decisions about largely homogeneous tasks, I routinely evaluate how hard it is to hack up a similar Python+requests+curses app to mimic Mutt. It's addictive. It's also mildly infuriating when someone builds a tool and forces you to use their "super special value-add web UI" without providing a stable and documented RESTful API.
Even if I can funnel only 90% of the stuff through my Mutt-like app and need to resort to the web UI for 10% of more special-case items, I still count that as a big win for my personal productivity (and sanity).
- leephillips 6y agoInteresting! I wonder how far one could get using Mutt itself, rather than coding a special-purpose curses program for each situation. In other words, convert whatever data you have into an mbox format, and use Mutt macros to take actions. Just thinking out loud here.
- herewulf 6y agoThis seems to be a use case for Emacs.
- figbert 6y agoUhh this sounds awesome. Is it open-source? Can I find it somewhere?
- steelframe 6y agoOkay, but only because people keep asking: https://github.com/SnakeyHacker/modpy/blob/main/main.py https://github.com/SnakeyHacker/modpy/blob/main/main.py I'm not proud of it. It's completely undocumented. I'm smack in the middle of completely rewriting what I had yesterday, and I haven't tested it in its current state. I've discovered PRAW and am trying to use it rather than make direct requests to Reddit's API. I'm not yet convinced that's a good idea. So it's almost certainly somehow broken right now. I can't promise I'll maintain it or pay any attention to bug reports or pull requests. But hey, sometimes random code on the internet just needs to be random code on the internet. Maybe it can inspire someone more competent and dedicated to a project like this to fire something up.