pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
Res facta quae tamen fingi potuit ([personal profile] pauamma) wrote in [site community profile] dw_dev2018-03-18 08:25 pm
Entry tags:

Question thread #62

It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

Re: enhanced Livejounal import

[staff profile] denise 2018-03-26 07:17 pm (UTC)(link)
CONTINUED:

If you want your script to do the edits for you, it will need to be a DW client. For something to be a DW client, it will need to understand the DW API. The caveat: the current (version 1.0) version of the API is... well, I'll be charitable and call it "outdated". (By which I mean, 'I don't think it was created in this century'.) It's XML-RPC, it has not aged well, and it's not really documented (because it's so old we're a little ashamed of it and we've been trying to write a replacement API that, you know, isn't old enough to vote.)

https://github.com/dreamwidth/dw-free/blob/develop/src/xmlrpc-client/journal.pl is a very old and not very featureful command-line client Brad used to use that will give you some ideas, and https://github.com/dreamwidth/dw-free/blob/develop/src/jbackup/jbackup.pl is relevant here again because it's also a client (it just isn't geared to pulling up specific entries for edits). I don't THINK we have any sample code for interacting-with-already-posted-entries clients but https://www.livejournal.com/doc/server/ljp.csp.protocol.html is the old LJ server docs for the XML-RPC API and we haven't changed THAT much. I think dw-free/cgi-bin/LJ/Protocol.pm is where the magic happens if you need to consult it.

(I am a lot fuzzier on that last bit than on the stuff in the other comment; if you get stuck anywhere, it's best to make a new top-level dw-dev post and hope someone who knows more than I do sees it.)

Re: enhanced Livejounal import

[personal profile] steve98052 2018-03-28 09:01 pm (UTC)(link)

My thought, based on the implementation that I proposed, was to build it as a client, because things like the data-link-conversion tag I imagined would require mucking with entries on both the source and destination journals.

I see that XML-RPC was the latest and greatest technology back when Livejournal went live, but yeah, in software years, it's antiquated. (And "old enough to vote" gave me a giggle.) But although it's an archaic interface, it's not a horribly complicated one. On the other hand, my Perl skills are negligible, so it might not be something I'd know how to do. On the other-other hand, if the client to do the job is substantial, learning Perl properly might be easier than coding the whole works in Java.