ext_45850: guitarist seen from behind, playing acoustic guitar behind head, with legend, "Can you hear me now?" (Default)
posted by [identity profile] dglenn.insanejournal.com at 10:14am on 2008-03-22
To crosspost using Clive, currently what I do is this: as I mentioned, I compiled a separate copy of Clive that defaults to each of the sites I journal on, and when I want to post an entry I type (in the 'tcsh' shell -- is you use BASH, ksh, or zsh the syntax is probably a little different):
foreach foo (ijclive ljclive gjclive scclive ...)
    $foo -p -u dglenn -w {password} -s "{subject}" < {filename} &
    end
where {filename} is whatever file I composed the entry in. Oh, I like to write out the HTML explicitly instead of having the server convert linebreaks -- that's what the -p is for. (And I don't really type out the list of clients each time. Instead I put the list into an environment variable in my .login file, so I just have to type "foreach foo ($CLIVES)".)

This is, admittedly, cumbersome even for me. It should be a shell script that works as a wrapper for Clive. But I ran into problems with the multiple layers of quoting for subject headers with spaces in them, and back-burnered that script. Of course, if I get around to hacking crossposting into Clive itself first, I won't need to debug that shell script.

And you can see here that I've done something rather dangerous, and am relying on something I got lucky with (using the same password at each site, and getting the same username at each site, respectively). Building crossposting support into Clive itself, if anybody but me will use it, needs to be done in a way that doesn't rely on those two things.

As to where I've gotten so far, changing one line to make it spit out the URL of the entry it just posted instead of the itemid assigned by the server (which is not the same number that appears inside the URL), meant that the temporary version of my 'postqotd' shell script could take the output of the post-to-IJ copy of Clive, run it through sed to turn it into the fake-cut-tag entry to post to LJ, and pipe that into the post-to-LJ copy of Clive. (And writing this paragraph has just reminded me that I forgot to switch it back to the regular version of 'postqotd'. Whoopsie!)

My to-do list for Clive is:
  • Add some degree of crossposting support,
  • Add a command-line option for setting tags on an entry when it's posted,
  • Add a command-line option to select at run time whether to report URL or itemid on success,
  • Find out whether the author of Clive has any interest in incorporating my modifications.


My ideas for how to better support crossposting are (so far): add a command-line option to select the journalling site to post to (which means using it the same way I do now, but only having to maintain a single executable that posts to all the different sites) or make it read a list of sites from the config file (or a second, just for crossposting, config file). For the first of those I've been mulling over two versions: either put the whole URL of the hosting site on the command line, or put the name (or user-supplied abbreviation) on the command line and have the program look up the URL that goes with that name in the config file.

(That is, whether to have the user add "-S www.insanejournal.com" to the command, or to have hir add "-S ij" and have a line in the config file that specifies that "ij" means "www.insanejournal.com".)



Until I read your comment, the idea of a hosted solution didn't even occur to me -- this was all a "download it to your computer and install it there" plan -- but now that you've put the idea in my head I'll spend a little time thinking about whether a hosted version would make sense, and how I'd want that to work if so.


Er ... did I actually wind up answering the questions you meant to ask in there anywhere?

Links

January

SunMonTueWedThuFriSat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24
 
25
 
26
 
27
 
28
 
29
 
30
 
31