cellio: (avatar-face)
Monica ([personal profile] cellio) wrote2013-03-15 05:17 pm
Entry tags:

LJ -> DW? (poll)

Lately, every time LJ pushes a new update they break legibility and accessibility a little more. This is becoming a problem. It's beyond my ability to correct with browser adaptations.

One of the reasons I haven't moved over to DreamWidth is that a lot of the people I interact with are still here. I'm concerned that y'all might not comment as much if I went there (you can log in with OpenID, but that may be a barrier to some), and the discussions in comments are a lot of the value of LJ to me. I don't need to post my stuff out into the silent void for my own amusement.

If I move there, then I could use Dreamwidth's cross-poster to post entries here too (to make it easy on my remaining LJ readers). Doing that requires giving DW my LJ password, which might cause some people to want to remove me from some or all of their filters, an outcome I don't want. (You're not just trusting me any more; you're trusting DW.) Since you all aren't moving to DW with me, I'd still need to come here to read the LJ-only people; what access would the cross-poster cost me?

So, poll time!

[Poll #1902385]

[identity profile] dglenn.livejournal.com 2013-03-17 07:28 am (UTC)(link)
What I'm using now for ordinary posts is a set of scripts with a manual step in the middle, that really ought to be one command except that I got distracted before I finished writing it. The quote of the day cron script is fully automatic and closely related. It's all running on BSD but ought to work on pretty much any Unix/Linux, maybe even under Cygwin (not sure about that one but it seems likely).

First step: I was already using Clive (http://sourceforge.net/projects/ljclive/), a command-line LJ client. I haven't gotten around to hacking a command-line switch into it to specify the destination site, so I've got separate copies compiled for each LJ-like site ... 'ljclive', 'ijclive', 'dwclive', etc. The cron-able version has a C program in the middle that forks each of those excelpt ljclive with a "retry, waiting longer before each attempt" loop in case a site is down -- after waiting long enough that most of the clives should have finished, it snarfs URLs from each clive's stdout and formats them (plus the fake-cut text it grepped out of the original QotD entry) into an LJ entry, the strips out most HTML and posts the stripped version to Facebook.

The ordinary-post version is only as complicated as it is in order to gather all the other-site entry URLs to put into the LJ entry, and have different text there. For you it'll be easier, especially if you're only using two sites. The core of what I do is use my favourite editor to create the body of my entry in a file named all.in, then (in tcsh) do this:

rm all.out ; touch all.out
foreach foo ( `echo $CLIVES | sed -e s/ljclive//` )
$foo -p -u dglenn -w mypassword -i iconname -s "subject-for-this-entry" < all.in | tee -a all.out &
end


(That's my 'all.script' script. The manual step is running 'lj.prep' to halfassedly snarf the URLs from all.out, tweak lj.in, and run a script very similar to the above but without any looping, called 'lj.script'. I should finish knitting the pieces together one of these months now...)

So for you it'd just be something along the lines of (I haven't tested this):

cp inputfile ljtmp.tmp
echo '

(Please comment at ' >> ljtmp.tmp
dwclive -p -u cellio -w yourpassword -i icon -s "subject" < input-file | grep http | sed -e 's/.*\(http[^ ]*\) .*/\1/' -e 's#\(http://[^.]*\.\)\([^.]*\)\(\..*\)#\2 (\1\2\3)#' >> ljtmp.tmp
echo 'if you can, but comment here if you cannot there.)' >> ljtmp.tmp
ljclive -p -u cellio -w yourpassword -i icon -s "subject" < ljtmp.tmp



(The sed recipe is copied out of my cron script ... I hope I grabbed the right chunk. It's only just now registering how cryptic that code looks.)

Better would be if I ever get around to hacking crossposting directly into Clive -- I meant to a couple of years ago but haven't done it yet (I'll probably do better at that than at figuring out the LJ API ... every time they change that I have to bother Clive's official maintainers for a patch). But in the meantime, you could do a script like the above and have the passwords passed in as command-line args. Also, I think Clive will prompt for a password if you don't give it one with -w but I'm not sure.

If your-favourite-editor-plus-a-shell-script is a reasonable workflow for you, I can look up my diffs for making the DW version of Clive. For me the reason I did this with Clive was that I'd already been using it when the only site I posted to was LJ, because vi-plus-tcsh is the most comfortable way for me to post.

Sorry for ... well, for the way I've been doing things for myself turning out to be so untidy. I've got to clean up my personal tools so I won't be embarrassed when somebody wants to see them. One of these months ...

[identity profile] dglenn.livejournal.com 2013-03-17 07:34 am (UTC)(link)
Argh! No 'preview' button on the comment page any more, at least w/ JS turned off, so I didn't catch whatever caused the spurious linefeeds after the first 'echo'. Sorry. And ... oh crud, the sed recipe got mangled. *sigh*

Let's see whether this works:
sed -e 's/.*\(http[^ ]*\) .*/\1/' -e 's#\(http://[^.]*\.\)\([^.]*\)\(\..*\)#<a href="\1\2\3">\2</a>#'
Edited 2013-03-17 07:37 (UTC)

[identity profile] dglenn.livejournal.com 2013-03-19 07:17 am (UTC)(link)
I need the money, but I've got a lot on my plate right now. I think I can knock this off fairly quickly once I have a chance to bang on it, but I'm not sure when. How much of a hurry are you in? I think I can manage it sometime in the next couple of weeks, if kin don't throw any surprises at me.