?

Log in

No account? Create an account
ljsh: Interactive shell for access to a LiveJournal admin console - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

ljsh: Interactive shell for access to a LiveJournal admin console [Feb. 8th, 2002|03:32 pm]
LiveJournal Client Discussions

lj_clients

[mart]
DESCRIPTION

This program will provide you with a shell from which LiveJournal admin console commands can be executed.

At minumum you must specify the user to connect as. With no other options, the program will prompt for a password and then connect to port 80 of www.livejournal.com and attempt to authenticate with the login protocol mode before giving a prompt from which admin console commands can be executed.

A command and its arguments can be given on the command line to make ljsh run in non-interactive mode and just execute that one command, output the result and exit.

SYNOPSIS
ljsh [options] user[@server] [command [args]]
 Options:
   --port=number     choose the port number to connect on (default 80)
   --interface=path  path to the protocol interface (default /interface/flat)
   --password=string password to use to authenticate
OPTIONS
--port
The port number to connect on. The default is the standard HTTP port, port 80.
--interface
The path to the protocol interface. The default is the standard flat handler, at /interface/flat.
--password
The password to use for authentication with the LiveJournal server. Normally this will be prompted for, but you can use this if running ljsh from a script or other non-interactive environment and are specifying a command on the command line.
DEPENDENCIES
  • Term::ReadLine
  • Term::ReadPassword
  • Getopt::Long
  • Pod::Usage
  • LWP::UserAgent
  • HTTP::Request
  • HTTP::Headers
  • Digest::MD5
  • Text::Wrap

ljsh.pl.

linkReply

Comments:
From: atl
2002-02-08 08:07 am (UTC)
Hi.
Found an error in the URL. it should have ~mart/ inserted in the right place.

I thought this was pretty nifty looking, and even imagined adding proxy support, until I looked again at exactly what it was. Ah. Not so useful to a mere LJ-mortal to me.
(Reply) (Thread)
[User Picture]From: mart
2002-02-08 08:40 am (UTC)

Thanks. I fixed up the URL.

It does actually have proxy support in a unixish way: you set the http_proxy environment variable before running it and it uses that proxy. (handled transparently by libwww-perl, actually)

Most LJ users only have access to mess with moodthemes and their friends list, so it's not really a lot of use to them admittedly. It's more just a little toy than of real use, since most LJ admin tasks are done from the web-based admin console.

If you were thinking of command-line based journal posting, I believe that jlj and LogJam can both do that, although I'm not completely sure.

(Reply) (Parent) (Thread)
From: evan
2002-02-08 08:58 am (UTC)
LogJam does, sorta, but I dunno if it works anymore. :\
(Reply) (Parent) (Thread)
From: atl
2002-02-08 09:20 am (UTC)
Oh, I had no idea libwww-perl would handle it so gracefully, but it makes sense, I guess. And I was aware of at least jlj for the CLI (I contributed the original proxy support for that one. I figured it would be a matter of reusing code :).

No, I thought this might be a shell for issuing "arbitrary" commands (from the modelist) to a server. I had been playing around with those on the command-line, with a combination of wget and a bunch of shell variables. Kind of a stupid way to spend the afternoon, but there you go. :)
(Reply) (Parent) (Thread)
[User Picture]From: mart
2002-02-08 09:26 am (UTC)

The LJ protocol doesn't really lend itself to command-lines. The only way I can really see it working is the ugly...

login user=test password=test

...since the parameters aren't in a particular order but rather key and value pairs. It would certainly be theoretically possible, but I think of even less use than ljsh! Remember also that entry text can be multiline, so it'd also need something like <

[Error: Irreparable invalid markup ('<here [...] ugly.</p>') in entry. Owner must fix manually. Raw contents below.]

<p>The LJ protocol doesn't really lend itself to command-lines. The only way I can really see it working is the ugly...</p> <pre>login user=test password=test</pre> <p>...since the parameters aren't in a particular order but rather key and value pairs. It would certainly be theoretically possible, but I think of even less use than ljsh! Remember also that entry text can be multiline, so it'd also need something like <<HERE string support, and it'd get pretty ugly.</p> <p>One thing I didn't actually think of with ljsh is using it from a shebang line in a script. I wonder if it works like that... probably not. What's the traditional way to tell the difference between a real terminal and piped input?</p>
(Reply) (Parent) (Thread)
[User Picture]From: mart
2002-02-08 09:27 am (UTC)

The one time I didn't check the preview I screwed up. I was intending to type "<<HERE string".

(Reply) (Parent) (Thread)
From: atl
2002-02-08 09:39 am (UTC)
pah, it came across in the email notification.

Can't say I know that difference. A brief view of the camel says that (fileno HANDLE == 0) for STDIN, but I doubt that's too handy.

Yeah, I made no claims for my idea being very useful, especially because the protocol is so dependent on state. ah well.
(Reply) (Parent) (Thread)