Hello, I'm writing a new command-line client for LiveJournal. There
are no so much command-lines client for livejournal, the only one I'm
aware of is clive. My client is somewhat similar to clive (i.e. it
uses $EDITOR for typing posts, supports 'header' like options setting
and can work in non-interactive mode (i.e. read stuff via args and
from stdin). However, it has a bit different philosophy behind it. So
here's the main points:
- Unix-way-ish: client consists of several small tools - one tool for
posting, one tool for listing posts, one tool for configuration
related stuff and so on. IMO, this approach has a lot of benefits:
the most important one is that it's handy for scripting, other
reason is that small tools are not overloaded with command line
options like do-all-in-one-tool could be and it's easier to write
such tools as well.
- Templates: before invoking $EDITOR, ecru loads predefined template
in which one can have predefined headers, predefined body, etc.
It's possible to have several templates, one for each type of post.
- Hooks (filters): before $EDITOR opens, ecru searches for executable
files in ~/.ecru/hooks and executes them, passing filename
preparing to be edited as a first argument of the script.
Therefore, you can do whatever you want in the script. And the
script could be written in any language. It could be used e.g. this
way: you can have 'current_music: `music.sh`' in the template and
get it replaced with the output of music.sh . Or you can
introduce any type of macros etc.
- Profile templates: it's possible to have several configuration
profiles and switch fast between them, could be useful if you have
several accounts.
State of things: post functionality is almost fully implemented. Other
tools for general stuff are almost ready. The features described above
are already implemented. I'm going to add more features: mutt-like
headers configuration, vcs-like status in the end of the post (which
would be ignored of course then posting) (optional), vcs like confirm
dialog (post/give up/etc) (optional), tools improvements for
scripting. The code is not very well tested and stable, however.
Here's a screenshot showing how it looks typing a post in vim:
http://people.freebsd.org/~novel/misc/ecru_vim.png And here's a short tutorial:
http://people.freebsd.org/~novel/misc/ecru-introduction.html git repository is hosted on github:
http://github.com/novel/ecru/tree/master I wonder if you're still reading :) but if you are, I would be glad to
hear if this project is interesting to anybody.