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_dev2017-10-15 11:24 pm
Entry tags:

Question thread #57

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.
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2017-10-16 01:22 am (UTC)(link)
Is there a good command-line client for Linux? Good meaning:
1. It lets me post preformatted HTML5, with unclosed [p] and [li] tags, and treats newlines as spaces as per the HTML spec. This probably rules out XML-RPC unless it will take the body of the post in a CDATA section.
2. The body of the post comes from STDIN. (I can write a temporary file if necessary, but I'd rather not.)
3. After it posts, it returns the ID of the post.
4. Ideally, it can edit a post.
5. It can be put in a Makefile or other shell script -- it mustn't ask the user for the password or borrow a cookie from a browser. I want to integrate it with my make- and git-based workflow.

If there isn't one, which API should I use to build one? I've been meaning to find one of these for a while; it's gotten more urgent now that my preferred client, ljupdate.el, stopped working presumably due to the HTTPS upgrade.

[personal profile] casimirian 2017-10-16 02:04 am (UTC)(link)
I'm not representing the dw-free project.

If you are running Linux to use SSH, you might be able to open code in geany (or an IDE) by connecting to your dreamhack with ssh either from your file system or geany directly.

If this interests you, let me know. :)
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2017-10-16 02:33 am (UTC)(link)
Hmm. I think you misunderstood me. I'm not looking for an IDE -- Emacs is my editor of choice for everything except huge multi-person Java projects, where I use Eclipse. What I'm looking for is a way to make DW posts from a script.

Specifically, I want to create a file in emacs (foo.html, for example) and then say "make foo.post" at the command line and have the contents of foo.html shipped off to my Dreamwidth blog, updated with the post's URL, and committed in git.

I could probably do it directly in a Makefile recipe with curl, but I'm not familiar enough with the API and the documentation is sketchy to nonexistent.
Edited 2017-10-16 02:34 (UTC)

[personal profile] casimirian 2017-10-16 02:37 am (UTC)(link)
Someone is working on API and should be done with it within the week if that interests you.

https://dw-dev.dreamwidth.org/200615.html

I used JLJ in the past to write blog posts. I think it still works but am waiting to build a new client with the newer API soon.

Here's the PR: https://github.com/dreamwidth/dw-free/pull/2015
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2017-10-16 02:51 am (UTC)(link)
Thanks! I'd seen the dw-dev post; definitely worth keeping an eye on.

JLJ looks like it might be a starting point, but it would definitely take a fair amount of work.

[personal profile] casimirian 2017-10-16 03:01 am (UTC)(link)
Understood. I am interested in any resources you may find. I too work with a shell most days and would find a shell-based client useful. I've begun work on a python-based client for the purpose of interacting with this future API, but it's far from complete. And I am reconsidering its design. Good luck!
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2017-10-16 03:11 am (UTC)(link)
Good luck to you as well -- I'll post here (I'm assuming clients are on-topic for dw-dev) when I have my makefile fragment working. It will eventually be part of ssavitzky/MakeStuff.
mdlbear: blue fractal bear with text "since 2002" (Default)

[personal profile] mdlbear 2017-10-16 02:43 am (UTC)(link)
Maybe I didn't make sufficiently clear that what I'm looking for is a command-line dreamwidth client -- a program that I can use to make Dreamwidth posts from a script.